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.
from patronus import contextclient = context.get_api_client().prompts# Add a label to a specific revisionclient.add_label( prompt_id="prompt_123", revision=3, label="production")
When you add a label that already exists, it updates to point to the new revision:
# Label points to revision 3client.add_label( prompt_id="prompt_123", revision=3, label="production")# Update label to point to revision 5client.add_label( prompt_id="prompt_123", revision=5, label="production")