Skip to content

LLMMessage

A single message in an LLM conversation.

Defined in: src/core/types/providers.ts:651

A single message in an LLM conversation.

Remarks

Represents one turn in a multi-turn conversation. The SDK accumulates these messages when ConversationHistoryConfig is enabled and passes them to generateFromMessages.

Example

const messages: LLMMessage[] = [
  { role: 'system', content: 'You are a helpful assistant.' },
  { role: 'user', content: 'What is the weather today?' },
  { role: 'assistant', content: 'I cannot check the weather, but I can help with other questions!' },
  { role: 'user', content: 'Tell me a joke instead.' },
];

See

Properties

PropertyTypeDescriptionDefined in
contentstringThe text content of the message.src/core/types/providers.ts:664
modality?"voice" | "text"How the message was produced. Remarks - 'voice' - Transcribed from speech via STT (default for user messages) - 'text' - Typed by the user via sendMessage() This is included in the conversation history so the LLM can adapt its response style (e.g., shorter for voice, richer formatting for text). Only meaningful for role: 'user' messages.src/core/types/providers.ts:677
role"system" | "user" | "assistant" | "tool"The role of the message author. Remarks - 'system' - System instructions (typically the first message) - 'user' - User input (transcribed speech or typed text) - 'assistant' - Assistant response (LLM output) - 'tool' - Tool execution result (sent back after a tool call)src/core/types/providers.ts:661
toolCallId?stringThe tool call ID this result belongs to (on tool messages).src/core/types/providers.ts:683
toolCalls?LLMToolCall[]Tool calls requested by the assistant (on assistant messages).src/core/types/providers.ts:680

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency