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