Arize Phoenix TS
    Preparing search index...
    • Format a list of prompt messages

      Parameters

      • format: "NONE" | "MUSTACHE" | "F_STRING"

        The format of the prompt message variables, e.g. MUSTACHE, F_STRING, NONE

      • promptMessages: {
            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: | string
                        | number
                        | boolean
                        | { [key: string]: unknown }
                        | unknown[]
                        | null;
                        type: "tool_result";
                    }
                )[];
            role: | "user"
            | "assistant"
            | "model"
            | "ai"
            | "tool"
            | "system"
            | "developer";
        }[]

        The prompt messages to format

        • 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: | string
                      | number
                      | boolean
                      | { [key: string]: unknown }
                      | unknown[]
                      | null;
                      type: "tool_result";
                  }
              )[]

          Content

        • role: "user" | "assistant" | "model" | "ai" | "tool" | "system" | "developer"

          Role

      • variables: Variables = {}

        The variables to use in the formatting

      Returns {
          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: | string
                      | number
                      | boolean
                      | { [key: string]: unknown }
                      | unknown[]
                      | null;
                      type: "tool_result";
                  }
              )[];
          role: | "user"
          | "assistant"
          | "model"
          | "ai"
          | "tool"
          | "system"
          | "developer";
      }[]

      The formatted prompt 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: | string
                    | number
                    | boolean
                    | { [key: string]: unknown }
                    | unknown[]
                    | null;
                    type: "tool_result";
                }
            )[]
      • role: "user" | "assistant" | "model" | "ai" | "tool" | "system" | "developer"

        Role