PromptsClient
adaline.prompts creates, reads, updates, and deletes prompts. Related prompt-scoped resources โ drafts, playgrounds, evaluators, and evaluations โ are exposed through nested sub-clients.
Access
Sub-clients
PromptsClient exposes four nested namespaces โ evaluators and evaluations are here (not at the top level) because every URL is /prompts/{promptId}/...:
Types used below come from
@adaline/api:
Prompt embeds a PromptSnapshot with the latest config, PromptMessage[], ToolFunction[], and PromptVariable[].
list()
List all prompts in a project (paginated). Usefields to trim the response payload.
Parameters
Returns
Promise<ListPromptsResponse> with shape { data: Prompt[]; pagination: { limit, returned, hasMore, nextCursor } }.
Example
create()
Create a new prompt in a project. The optionaldraft seeds the promptโs initial config, messages, and tools.
Parameters
CreatePromptRequest (abbreviated):
configโ see PromptSnapshotConfigmessagesโ see PromptMessage and the MessageContent uniontoolsโ see ToolFunction
Returns
Promise<Prompt> โ the created prompt, including server-generated id and draft state.
Example
get()
Retrieve a single prompt by ID. Useexpand: 'playground' to include the default playground inline. Use fields to trim the response.
Parameters
Returns
Promise<Prompt> โ full prompt with config, messages, tools, variables, and (if requested) playground data.
Example
update()
Partially update a prompt. You can update title, icon, config, messages, tools, or the default playground. Any field you omit is left untouched. Sent asPATCH under the hood.
Parameters
Returns
Promise<Prompt> โ the full updated prompt.
Example
delete()
Permanently delete a prompt and all associated resources (drafts, playgrounds, deployments, evaluators, evaluations). Irreversible.Example
See Also
- PromptDraftClient โ
adaline.prompts.draft.get(...) - PromptPlaygroundsClient โ
adaline.prompts.playgrounds.* - PromptEvaluatorsClient โ
adaline.prompts.evaluators.* - PromptEvaluationsClient โ
adaline.prompts.evaluations.* - Adaline class โ constructor and top-level methods
- PromptSnapshot โ the shape of
prompt.config/ messages / tools / variables - API reference: List prompts ยท Create ยท Get ยท Update ยท Delete