The
prompts client methods are currently in BETA. The API may change without notice. A one-time warning is emitted on first use.production) point to a specific version. The Get, Update, Delete, ListVersions, CreateVersion, and GetVersionByLabel methods accept either a prompt name or an ID — when a name is passed, the parent Space (name or ID) is also required so the SDK can resolve the name to a unique ID. GetVersion, SetVersionLabels, and DeleteVersionLabel take strict version IDs only.
List Prompts
List returns a paginated list of prompts. When Space is a base64 resource ID, it is sent as the space_id filter (exact match); otherwise it is sent as the space_name filter (case-insensitive substring match).
Signature:
Get a Prompt
Get returns a single prompt (with one of its versions), resolving by name or ID. If VersionID or Label is set, the response carries that specific version; otherwise the latest version is returned. VersionID and Label are mutually exclusive.
Signature:
Create a Prompt
Create creates a new prompt with its initial version, resolving the parent space by name or ID.
Signature:
Update a Prompt
Update patches an existing prompt’s metadata, resolving the target by name or ID, and returns the updated prompt. Description is a pointer — nil preserves the existing value, a pointer to an empty string clears the field.
Signature:
Delete a Prompt
Delete removes a prompt, resolving by name or ID. It returns only an error.
Signature:
List Versions
ListVersions returns a paginated list of versions for a prompt, resolving the prompt by name or ID.
Signature:
Create a Version
CreateVersion creates a new version for an existing prompt, resolving the prompt by name or ID.
Signature:
Get a Version
GetVersion returns a single prompt version by its ID. Version IDs are strict IDs — no name resolution is performed.
Signature:
Get a Version by Label
GetVersionByLabel returns the prompt version pointed to by a label (e.g. "production"), resolving the prompt by name or ID.
Signature:
Set Version Labels
SetVersionLabels assigns one or more labels to a specific prompt version, replacing all existing labels, and returns the updated label set. Pass an empty slice to remove all labels. Version IDs are strict IDs.
Signature:
Delete a Version Label
DeleteVersionLabel removes a single label from a specific prompt version. It returns only an error. Version IDs are strict IDs.
Signature: