A developer is implementing an agent that uses extended thinking to solve complex math problems. The agent must expose its reasoning process to an internal audit log but must not show thinking blocks to end users. When reading the streaming response, how should the application differentiate thinking block content from final answer content?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — b is correct because the Anthropic streaming API signals the type of each content block via the type field in the content_block_start event. When extended thinking is enabled, the stream includes blocks with type 'thinking' (for the reasoning process) and type 'text' (for the final answer).
Full explanation below image
Full Explanation
B is correct because the Anthropic streaming API signals the type of each content block via the type field in the content_block_start event. When extended thinking is enabled, the stream includes blocks with type 'thinking' (for the reasoning process) and type 'text' (for the final answer). The application maintains a state variable tracking the current block type and routes content_block_delta events to the appropriate handler — audit log for thinking, user display for text. This allows real-time streaming of both channels simultaneously. A is wrong because thinking blocks always appear before text blocks in the stream, not last; the order is thinking → text, since the model generates reasoning before its final answer. C is wrong because the API does not use multiple parallel HTTP responses; all content is delivered in a single SSE stream with typed events. D is wrong because the Anthropic API does support streaming with extended thinking enabled; thinking blocks appear in the stream with the type discriminator described in B.