InternalCreates a new PromptManager instance.
Configuration object containing the API client
Creates a new prompt in Langfuse.
The prompt data to create (chat prompt)
Promise that resolves to a ChatPromptClient
Creates a new prompt in Langfuse.
The prompt data to create (text prompt)
Promise that resolves to a TextPromptClient
Creates a new prompt in Langfuse.
The prompt data to create (chat prompt)
Promise that resolves to a ChatPromptClient
Delete prompt versions. If neither version nor label is specified, all versions of the prompt are deleted.
The Langfuse SDK prompt cache is invalidated for all cached versions with the specified name.
Name of the prompt to delete
Optionaloptions: { label?: string; version?: number }Optional deletion configuration
Optionallabel?: stringOptional label to filter deletion. If specified, deletes all prompt versions with this label
Optionalversion?: numberOptional version to delete. If specified, deletes only this specific version
Promise that resolves when deletion is complete
Retrieves a text prompt by name.
Name of the prompt to retrieve
Optionaloptions: {Optional retrieval configuration
OptionalcacheTtlSeconds?: numberCache TTL in seconds (0 to disable caching)
Optionalfallback?: stringFallback text content if prompt fetch fails
OptionalfetchTimeoutMs?: numberRequest timeout in milliseconds
Optionallabel?: stringLabel to filter by
OptionalmaxRetries?: numberMaximum retry attempts for failed requests
Optionaltype?: "text"Specify text prompt type
Optionalversion?: numberSpecific version to retrieve (defaults to latest)
Promise that resolves to a TextPromptClient
Retrieves a chat prompt by name.
Name of the prompt to retrieve
Optionaloptions: {Optional retrieval configuration
OptionalcacheTtlSeconds?: numberCache TTL in seconds (0 to disable caching)
Optionalfallback?: ChatMessage[]Fallback chat messages if prompt fetch fails
OptionalfetchTimeoutMs?: numberRequest timeout in milliseconds
Optionallabel?: stringLabel to filter by
OptionalmaxRetries?: numberMaximum retry attempts for failed requests
Specify chat prompt type
Optionalversion?: numberSpecific version to retrieve (defaults to latest)
Promise that resolves to a ChatPromptClient
Updates the labels of an existing prompt version.
Update parameters
Name of the prompt to update
New labels to apply to the prompt version
Version number of the prompt to update
Promise that resolves to the updated prompt
Manager for prompt operations in Langfuse.
Provides methods to create, retrieve, and manage prompts with built-in caching for optimal performance. Supports both text and chat prompts with variable substitution and placeholder functionality.