ChatMessages - TypeScript SDK

ChatMessages type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Chat completion message with role-based discrimination

Supported Types

models.ChatAssistantMessage

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

models.ChatDeveloperMessage

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

models.ChatSystemMessage

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

models.ChatToolMessage

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

models.ChatUserMessage

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