LLM.Stream.Thinking (LLM v0.1.2)

Copy Markdown View Source

A thinking/reasoning chunk from a streaming response.

Emitted by providers that support extended thinking (Anthropic, Gemini, OpenAI o-series). Thinking chunks contain the model's internal reasoning process, separate from the final response text.

Fields

  • :text — the reasoning text fragment
  • :signature — optional cryptographic signature (Anthropic) for thinking block verification

Example

%LLM.Stream.Thinking{text: "Let me consider the user's question...", signature: nil}

# Anthropic includes a signature for verification
%LLM.Stream.Thinking{
  text: "The user is asking about...",
  signature: "EqQBCgIYAhIM..."
}

Summary

Types

t()

@type t() :: %LLM.Stream.Thinking{signature: String.t() | nil, text: String.t()}