Member Junction
    Preparing search index...

    Type Alias OpenAICompatibleChatMessage

    OpenAICompatibleChatMessage:
        | { content: string; role: "system"; [key: string]: unknown }
        | { content: string; role: "user"; [key: string]: unknown }
        | {
            content: string;
            role: "assistant";
            tool_calls?: OpenAICompatibleToolCall[];
            [key: string]: unknown;
        }

    A non-tool message in the OpenAI-compatible request body.

    Discriminated on role rather than a single interface with a union-typed role, because every provider SDK models it that way — a flat interface fails to narrow when assigned to theirs. tool_calls rides on the assistant turn; without it the tool messages answering those calls are orphaned and the provider rejects the conversation.