Member Junction
    Preparing search index...

    Variable ChatMessageRoleConst

    ChatMessageRole: {
        assistant: "assistant";
        system: "system";
        tool: "tool";
        user: "user";
    } = ...

    The possible roles for a chat message.

    tool carries the RESULT of a native tool call back to the model and is only ever produced alongside a preceding assistant turn whose ChatMessage.toolCalls it answers. Its content is one or more tool_result ChatMessageContentBlocks. Drivers that do not implement tools (BaseLLM.SupportsTools === false) map it to user like any other non-assistant role, so an unsupported driver degrades to prose rather than erroring.

    Type Declaration

    • Readonlyassistant: "assistant"
    • Readonlysystem: "system"
    • Readonlytool: "tool"
    • Readonlyuser: "user"