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}/...:
| Property | Client | Covers |
|---|---|---|
adaline.prompts.draft | PromptDraftClient | Get the current draft |
adaline.prompts.playgrounds | PromptPlaygroundsClient | List / get playgrounds |
adaline.prompts.evaluators | PromptEvaluatorsClient | CRUD for evaluators attached to the prompt |
adaline.prompts.evaluations | PromptEvaluationsClient | Create / list / cancel evaluation runs (+ .results for per-row results) |
@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
| Name | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | Project whose prompts should be returned. |
limit | number | No | Page size (default 50, max 200). |
cursor | string | No | Opaque cursor from a previous responseโs pagination.nextCursor. |
sort | SortOrder | No | "createdAt:asc" or "createdAt:desc". |
createdAfter | number | No | Unix milliseconds. |
createdBefore | number | No | Unix milliseconds. |
fields | string | No | Comma-separated list of top-level fields to include (e.g. "id,title,createdAt"). |
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
| Name | Type | Required | Description |
|---|---|---|---|
prompt | CreatePromptRequest | Yes | Prompt definition. |
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
| Name | Type | Required | Description |
|---|---|---|---|
promptId | string | Yes | Prompt identifier. |
expand | 'playground' | No | Include the default playground in the response. |
fields | string | No | Comma-separated list of top-level fields to include. |
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
| Name | Type | Required | Description |
|---|---|---|---|
promptId | string | Yes | Prompt identifier. |
playgroundId | string | No | When patching playground-scoped fields, identifies which playground to update. |
prompt | PatchPromptRequest | Yes | Fields to update โ all top-level keys are optional. |
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