Skip to main content

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

The class is also exported directly:

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). Use fields 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 optional draft seeds the promptโ€™s initial config, messages, and tools.

Parameters

CreatePromptRequest (abbreviated):

Returns

Promise<Prompt> โ€” the created prompt, including server-generated id and draft state.

Example


get()

Retrieve a single prompt by ID. Use expand: '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 as PATCH 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