Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Chat completion message with role-based discrimination

Supported Types

models.ChatAssistantMessage

const value: models.ChatAssistantMessage = {
  role: "assistant",
};

models.ChatDeveloperMessage

const value: models.ChatDeveloperMessage = {
  content: "What is the capital of France?",
  role: "developer",
};

models.ChatSystemMessage

const value: models.ChatSystemMessage = {
  content: "What is the capital of France?",
  role: "system",
};

models.ChatToolMessage

const value: models.ChatToolMessage = {
  content: "What is the capital of France?",
  role: "tool",
  toolCallId: "call_abc123",
};

models.ChatUserMessage

const value: models.ChatUserMessage = {
  content: "What is the capital of France?",
  role: "user",
};