Thinking Events Contract

A reasoning stream consists of three event types that must follow a specific sequence:

Event Type
Description
When to Emit

thinking_start

Marks the beginning of a reasoning stream

Before LLM starts reasoning

thinking

Contains reasoning content (can occur multiple times). Type: Markdown.

During LLM reasoning (streamed)

thinking_end

Marks the end of a reasoning stream

After LLM completes reasoning

Event Structure

{
  "data_type": Literal["thinking_start" | "thinking" | "thinking_end"],
  "data_value": string,  // Reasoning content (empty for start/end)
  "id": string           // Unique identifier for thinking block
}

Last updated