Skip to main content
The prompts module lets you create prompt versions in Phoenix, fetch them back by selector, list prompts, update a prompt’s description and metadata, delete a prompt, and adapt prompt versions to supported provider SDKs.

Relevant Source Files

  • src/prompts/getPrompt.ts for the exact selector shape

Create A Prompt

Fetch By Selector

prompt can be selected by { name }, { name, tag }, or { versionId }.

Update Description And Metadata

promptIdentifier is a prompt name or ID. Omit a field to leave it unchanged, and pass description: null to clear it. metadata replaces the existing metadata object as a whole rather than merging into it. Requires a Phoenix server on 19.18.0 or later.

Delete A Prompt

prompt takes the same selector style as getPrompt, narrowed to the two selectors that identify a prompt rather than one of its versions: { name } and { promptId }. Passing a version selector — { versionId }, or { name, tag } — rejects instead of falling back to the whole prompt, so a variable holding a version never deletes more than you named. Deletion cascades: every version of the prompt, along with its version tags and labels, is removed with it, and the deletion cannot be undone. A prompt that does not exist rejects with Prompt not found: <identifier>. Requires a Phoenix server on 13.20.0 or later.

Convert To Another SDK

Supported sdk targets:
  • ai
  • openai
  • anthropic

Source Map

  • src/prompts/createPrompt.ts
  • src/prompts/deletePrompt.ts
  • src/prompts/getPrompt.ts
  • src/prompts/listPrompts.ts
  • src/prompts/updatePrompt.ts
  • src/prompts/sdks/toSDK.ts
  • src/types/prompts.ts