Our docs got a refresh! Check out the new content and improved navigation. For detailed API reference see our Python SDK docs and TypeScript SDK.
Prompts
Labels and Metadata
Manage prompt versions with labels and attach metadata
Labels provide stable references to specific prompt revisions, while metadata allows you to attach arbitrary configuration and documentation to prompts.
Labels allow you to create stable references to specific prompt revisions. This is useful for managing prompts across environments like development, staging, and production.
A label is unique within a prompt definition — applying a label to a new revision moves it off the previous revision.
Labels operate on a specific prompt revision, identified by its revision_id (a UUID). List the revisions for a prompt definition by name to find the one you need:
from patronus import contextclient = context.get_api_client()revisions = client.prompts.list_revisions(prompt_name="support/chat/system")for r in revisions.prompt_revisions: print(r.id, r.revision, r.labels)
r.id is the revision_id to pass to the calls below.