• A helper function to construct a prompt version declaratively.

    The output of this function can be used to create a prompt version in Phoenix.

    Parameters

    • params: PromptVersionInput

      The parameters to create a prompt version.

    Returns {
        description?: null | string;
        invocation_parameters:
            | {
                anthropic: {
                    max_tokens: number;
                    stop_sequences?: string[];
                    temperature?: number;
                    top_p?: number;
                };
                type: "anthropic";
            }
            | {
                azure_openai: {
                    frequency_penalty?: number;
                    max_completion_tokens?: number;
                    max_tokens?: number;
                    presence_penalty?: number;
                    reasoning_effort?: "low"
                    | "medium"
                    | "high";
                    seed?: number;
                    temperature?: number;
                    top_p?: number;
                };
                type: "azure_openai";
            }
            | {
                google: {
                    frequency_penalty?: number;
                    max_output_tokens?: number;
                    presence_penalty?: number;
                    stop_sequences?: string[];
                    temperature?: number;
                    top_k?: number;
                    top_p?: number;
                };
                type: "google";
            }
            | {
                openai: {
                    frequency_penalty?: number;
                    max_completion_tokens?: number;
                    max_tokens?: number;
                    presence_penalty?: number;
                    reasoning_effort?: "low"
                    | "medium"
                    | "high";
                    seed?: number;
                    temperature?: number;
                    top_p?: number;
                };
                type: "openai";
            };
        model_name: string;
        model_provider: "OPENAI"
        | "AZURE_OPENAI"
        | "ANTHROPIC"
        | "GOOGLE";
        response_format?:
            | null
            | {
                json_schema: {
                    description?: string;
                    name: string;
                    schema?: Record<string, unknown>;
                    strict?: boolean;
                };
                type: "json_schema";
            };
        template: | {
            messages: {
                content: | string
                | (
                    | { text: string; type: "text" }
                    | {
                        tool_call: { arguments: string; name: string; type: "function" };
                        tool_call_id: string;
                        type: "tool_call";
                    }
                    | {
                        tool_call_id: string;
                        tool_result: | null
                        | string
                        | number
                        | boolean
                        | Record<(...), (...)>
                        | (...)[];
                        type: "tool_result";
                    }
                )[];
                role: | "user"
                | "assistant"
                | "model"
                | "ai"
                | "tool"
                | "system"
                | "developer";
            }[];
            type: "chat";
        }
        | { template: string; type: "string" };
        template_format: "MUSTACHE" | "F_STRING" | "NONE";
        template_type: "STR" | "CHAT";
        tools?:
            | null
            | {
                disable_parallel_tool_calls?: boolean;
                tool_choice?: | { type: "none" }
                | { type: "one_or_more" }
                | { function_name: string; type: "specific_function" }
                | { type: "zero_or_more" };
                tools: {
                    function: {
                        description?: string;
                        name: string;
                        parameters?: Record<string, unknown>;
                        strict?: boolean;
                    };
                    type: "function";
                }[];
                type: "tools";
            };
    }

    Structured prompt version data, not yet persisted to Phoenix.

    • Optionaldescription?: null | string

      Description

    • invocation_parameters:
          | {
              anthropic: {
                  max_tokens: number;
                  stop_sequences?: string[];
                  temperature?: number;
                  top_p?: number;
              };
              type: "anthropic";
          }
          | {
              azure_openai: {
                  frequency_penalty?: number;
                  max_completion_tokens?: number;
                  max_tokens?: number;
                  presence_penalty?: number;
                  reasoning_effort?: "low"
                  | "medium"
                  | "high";
                  seed?: number;
                  temperature?: number;
                  top_p?: number;
              };
              type: "azure_openai";
          }
          | {
              google: {
                  frequency_penalty?: number;
                  max_output_tokens?: number;
                  presence_penalty?: number;
                  stop_sequences?: string[];
                  temperature?: number;
                  top_k?: number;
                  top_p?: number;
              };
              type: "google";
          }
          | {
              openai: {
                  frequency_penalty?: number;
                  max_completion_tokens?: number;
                  max_tokens?: number;
                  presence_penalty?: number;
                  reasoning_effort?: "low"
                  | "medium"
                  | "high";
                  seed?: number;
                  temperature?: number;
                  top_p?: number;
              };
              type: "openai";
          }

      Invocation Parameters

    • model_name: string

      Model Name

    • model_provider: "OPENAI" | "AZURE_OPENAI" | "ANTHROPIC" | "GOOGLE"
    • Optionalresponse_format?:
          | null
          | {
              json_schema: {
                  description?: string;
                  name: string;
                  schema?: Record<string, unknown>;
                  strict?: boolean;
              };
              type: "json_schema";
          }

      Response Format

    • template:
          | {
              messages: {
                  content: | string
                  | (
                      | { text: string; type: "text" }
                      | {
                          tool_call: { arguments: string; name: string; type: "function" };
                          tool_call_id: string;
                          type: "tool_call";
                      }
                      | {
                          tool_call_id: string;
                          tool_result: | null
                          | string
                          | number
                          | boolean
                          | Record<(...), (...)>
                          | (...)[];
                          type: "tool_result";
                      }
                  )[];
                  role: | "user"
                  | "assistant"
                  | "model"
                  | "ai"
                  | "tool"
                  | "system"
                  | "developer";
              }[];
              type: "chat";
          }
          | { template: string; type: "string" }

      Template

    • template_format: "MUSTACHE" | "F_STRING" | "NONE"
    • template_type: "STR" | "CHAT"
    • Optionaltools?:
          | null
          | {
              disable_parallel_tool_calls?: boolean;
              tool_choice?: | { type: "none" }
              | { type: "one_or_more" }
              | { function_name: string; type: "specific_function" }
              | { type: "zero_or_more" };
              tools: {
                  function: {
                      description?: string;
                      name: string;
                      parameters?: Record<string, unknown>;
                      strict?: boolean;
                  };
                  type: "function";
              }[];
              type: "tools";
          }