1. A team is streaming responses from the Anthropic Messages API using server-sent events. They need to detect the moment the model finishes generating so they can trigger a downstream process. Which event type in the Anthropic streaming protocol signals that the message is fully complete?
- A. `content_block_stop`
- B. `message_delta` with `stop_reason: "end_turn"`
- C. `message_stop`✓ Correct
- D. `stream_end`
Explanation
`message_stop` is the final event emitted by the Anthropic streaming API and definitively signals that the entire message, including all content blocks, has been fully generated and the stream is closed. **Why the distractors are wrong:** - (A) `content_block_stop` signals the end of a single content block (e.g., a text segment), not the end of the full message. Multiple content blocks can exist in one message. - (B) `message_delta` with `stop_reason: "end_turn"` carries metadata about why generation stopped, but it precedes `message_stop`; it is not itself the terminal signal. - (D) `stream_end` is not a real Anthropic SSE event type; this is a distractor.