Skip to main content

Documentation Index

Fetch the complete documentation index at: https://arizeai-433a7140-mikeldking-12899-providers-and-secrets.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

The prompts module lets you create prompt versions in Phoenix, fetch them back by selector, list prompts, and adapt prompt versions to supported provider SDKs.

Relevant Source Files

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

Create A Prompt

import {
  createPrompt,
  promptVersion,
} from "@arizeai/phoenix-client/prompts";

await createPrompt({
  name: "support-response",
  description: "Customer support reply prompt",
  version: promptVersion({
    modelProvider: "OPENAI",
    modelName: "gpt-4o-mini",
    template: [{ role: "user", content: "Reply to {{question}}" }],
  }),
});

Fetch By Selector

import { getPrompt } from "@arizeai/phoenix-client/prompts";

const prompt = await getPrompt({
  prompt: { name: "support-response", tag: "production" },
});
prompt can be selected by { name }, { name, tag }, or { versionId }.

Convert To Another SDK

import { toSDK } from "@arizeai/phoenix-client/prompts";

const promptAsAI = toSDK({
  sdk: "ai",
  prompt,
  variables: { question: "Where is my order?" },
});
Supported sdk targets:
  • ai
  • openai
  • anthropic

Source Map

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