Content Block

API

Definition

The structured units that make up Claude's response. Types include: 'text' (plain text response), 'tool_use' (a request to call a tool with specific inputs), and 'thinking' (internal reasoning when extended thinking is enabled). A single response can contain multiple content blocks.

Example Usage

Iterate over response.content to process each block: text blocks go to the user, tool_use blocks trigger function calls.