Parameters
- format: "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: | null
| string
| number
| boolean
| Record<string, unknown>
| unknown[];
type: "tool_result";
}
)[];
role: | "user"
| "assistant"
| "model"
| "ai"
| "tool"
| "system"
| "developer";
}[]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<string, unknown>
| unknown[];
type: "tool_result";
}
)[]
role: "user" | "assistant" | "model" | "ai" | "tool" | "system" | "developer"
- variables: Variables = {}
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: | null
| string
| number
| boolean
| Record<string, unknown>
| unknown[];
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: | null
| string
| number
| boolean
| Record<string, unknown>
| unknown[];
type: "tool_result";
}
)[]
role: "user" | "assistant" | "model" | "ai" | "tool" | "system" | "developer"
Format a list of prompt messages