Runtime Parameters
Every prompt version can carry aparameters object: arbitrary JSON that is versioned, tagged, and fetched together with the prompt itself. Use it for application settings that should change in lockstep with the prompt — search iteration limits, confidence thresholds, structured output schemas, metadata field lists, feature switches.
Available since Python SDK
0.26.0 and TypeScript SDK 0.33.0 (reading prompt.parameters works from Python SDK 0.25.0; writing via create/update requires 0.26.0). Changing parameters creates a new prompt version, just like changing the prompt text.Why
Prompts rarely live alone. The code around them has knobs — how many retrieval rounds to run, what score counts as confident, which fields to extract. When those knobs are hardcoded, a prompt rollback doesn’t roll them back. Storing them inparameters means one versioned unit: deploy, tag, and revert prompt + settings together.
Shape
parameters is an object with arbitrary JSON values (nested objects and arrays included). It defaults to {}. LangWatch does not interpret its contents — your application owns the schema.
Reading parameters
Python SDK
TypeScript SDK
REST API
Writing parameters
Python SDK
TypeScript SDK
REST API
Versioning behavior
- Updating
parameters(even with no other change) creates a new prompt version with its ownversionId. - Restoring an older version restores that version’s
parameterstoo. - Tags (
production,staging, custom) resolve to a version, so fetching by tag always returns the matchingparameters. - Explicit updates (
PUT, SDKupdate) always create a new version, even if the content is unchanged. - The sync endpoint (
POST /api/prompts/{id}/sync, used by the CLI) compares content key-order independently — re-syncing the same parameters with keys in a different order reportsup_to_dateand does not create a new version.