Expand description
Cross-dialect canonical representation.
The central model is content items — a typed, ordered list per message. Anthropic Messages, OpenAI Responses, and Gemini all share this shape natively; OpenAI Chat/Completions is the only dialect that hoists tool calls into a side-array, and that asymmetry is normalized at the dialect adapter boundary.
Invariants enforced here:
ItemStreamMessage.itemspreserves order verbatim from the wire.ToolCall.idis non-empty;ToolResult.tool_call_idreferences a priorToolCallin the same conversation.Thinking.signatureis opaque and never fabricated;Nonepropagates asNonethrough dialects that support unsigned thinking (all except Anthropic-signed).Text("")is legal in the model; dropping happens in dialect code (Gemini rejects empty parts upstream).
Lossy notes are documented per-dialect; the canonical model itself stays lossless.