Interface: ChatPrompt
A chat prompt is a combination of a system message and a list of user, assistant, and tool messages.
The user messages can contain multi-modal content. The assistant messages can contain tool calls.
Note: Not all models and prompt formats support multi-modal inputs and tool calls. The validation happens at runtime.
Example
const chatPrompt: ChatPrompt = {
system: "You are a celebrated poet.",
messages: [
{ role: "user", content: "Write a short story about a robot learning to love." },
{ role: "assistant", content: "Once upon a time, there was a robot who learned to love." },
{ role: "user", content: "That's a great start!" },
],
};
Properties
messages
• messages: ChatMessage
[]
Defined in
packages/modelfusion/src/model-function/generate-text/prompt-template/ChatPrompt.ts:37
system
• Optional
system: string
Defined in
packages/modelfusion/src/model-function/generate-text/prompt-template/ChatPrompt.ts:36