get_prompt
Retrieve a specific prompt by name with resolved dependencies from Langfuse. Use optional label or version parameters to fetch the desired prompt version.
Instructions
Fetch a specific prompt by name with resolved dependencies.
Retrieves a prompt from Langfuse with all dependency tags resolved. Uses the SDK's
built-in caching for optimal performance.
Args:
ctx: Context object containing lifespan context with Langfuse client
name: The name of the prompt to fetch
label: Optional label to fetch (e.g., 'production'). Cannot be used with version.
version: Optional specific version number. Cannot be used with label.
Returns:
A dictionary containing the prompt details:
- id: Unique prompt identifier
- name: Prompt name
- version: Version number
- type: 'text' or 'chat'
- prompt: The prompt content (string for text, list for chat)
- labels: List of labels assigned to this version
- tags: List of tags
- config: Model configuration (temperature, model, etc.)
Raises:
ValueError: If both label and version are specified
LookupError: If prompt not found
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the prompt to fetch | |
| label | No | Label to fetch (e.g., 'production', 'staging'). Mutually exclusive with version. | |
| version | No | Specific version number to fetch. Mutually exclusive with label. |