PromptsClient
adaline.prompts creates, reads, updates, and deletes prompts. Related prompt-scoped resources — drafts, playgrounds, evaluators, and evaluations — are exposed through nested sub-clients. Every method is async.
Access
Sub-clients
PromptsClient exposes four nested namespaces — evaluators and evaluations are here (not at the top level) because every URL is /prompts/{prompt_id}/...:
| Attribute | 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 prompts in a project (paginated).Parameters
| Name | Type | Required | Description |
|---|---|---|---|
project_id | str | Yes | Project whose prompts should be returned. |
limit | Optional[int] | No | Page size (default 50, max 200). |
cursor | Optional[str] | No | Opaque cursor from a previous response. |
sort | Optional[SortOrderInput] | No | Sort order. |
created_after / created_before | Optional[int] | No | Unix millisecond bounds. |
fields | Optional[str] | No | Comma-separated top-level fields to include. |
Returns
ListPromptsResponse with { data: list[Prompt]; pagination: Pagination }.
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. |
Returns
Prompt — the created prompt.
Example
get()
Retrieve a single prompt by ID. Useexpand="playground" to include the default playground.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
prompt_id | str | Yes | Prompt identifier. |
expand | Optional[str] | No | Pass "playground" to include the default playground. |
fields | Optional[str] | No | Comma-separated top-level fields to include. |
Example
update()
Partially update a prompt. Sent asPATCH under the hood. Any field you omit is left untouched.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
prompt_id | str | Yes | Prompt identifier. |
prompt | PatchPromptRequest | Yes | Fields to update (all optional). |
playground_id | Optional[str] | No | When patching playground-scoped fields, identifies which playground to update. |
Example
delete()
Permanently delete a prompt and all associated resources (drafts, playgrounds, deployments, evaluators, evaluations). Irreversible.See Also
- PromptDraftClient —
adaline.prompts.draft.get(...) - PromptPlaygroundsClient
- PromptEvaluatorsClient
- PromptEvaluationsClient
- Adaline class
- PromptSnapshot
- API reference: List prompts · Create · Get · Update