ClaudeCode.Content.ThinkingBlock (ClaudeCode v0.16.0)

View Source

Represents a thinking content block within a Claude message.

Thinking blocks contain Claude's extended reasoning, visible when extended thinking is enabled on supported models.

Summary

Functions

Creates a new Thinking content block from JSON data.

Type guard to check if a value is a Thinking content block.

Types

t()

@type t() :: %ClaudeCode.Content.ThinkingBlock{
  signature: String.t(),
  thinking: String.t(),
  type: :thinking
}

Functions

new(data)

@spec new(map()) :: {:ok, t()} | {:error, atom() | {:missing_fields, [atom()]}}

Creates a new Thinking content block from JSON data.

Examples

iex> Thinking.new(%{"type" => "thinking", "thinking" => "Let me reason...", "signature" => "sig_123"})
{:ok, %Thinking{type: :thinking, thinking: "Let me reason...", signature: "sig_123"}}

iex> Thinking.new(%{"type" => "text"})
{:error, :invalid_content_type}

thinking_content?(arg1)

@spec thinking_content?(any()) :: boolean()

Type guard to check if a value is a Thinking content block.