Member Junction
    Preparing search index...

    Type Alias ChatCompletionMessage

    Defines the shape of an individual message from the model in response to a chat completion request.

    type ChatCompletionMessage = {
        content: string;
        role: "assistant";
        thinking?: string | null;
        toolCalls?: ChatToolCall[];
    }
    Index

    Properties

    content: string

    Content of the message, can be any string

    role: "assistant"

    Role of the message in the conversation. For completions, this is always 'assistant'.

    thinking?: string | null

    When using a reasoning model, this field can contain the reasoning behind the response. Not all providers/models support this field.

    toolCalls?: ChatToolCall[]

    Tool calls the model made on this turn, normalized across providers. Absent or empty when the model did not call a tool.

    A turn can carry BOTH content and toolCalls — the tool-capable providers structurally allow it (Anthropic text + tool_use blocks, OpenAI nullable content alongside tool_calls, Gemini text + functionCall parts) — so this is never an either/or with content. Equally, nothing downstream may assume content is non-empty on a tool-call turn: a forced ChatToolChoice usually suppresses text entirely.