Nous.StreamNormalizer.Anthropic (nous v0.13.3)
View SourceStream normalizer for Anthropic API.
Handles Anthropic's SSE streaming format where events arrive as JSON maps
with a "type" field indicating the event kind.
Streaming Event Types
| Anthropic Event | Normalized Output |
|---|---|
content_block_delta + text_delta | {:text_delta, text} |
content_block_delta + thinking_delta | {:thinking_delta, text} |
content_block_delta + input_json_delta | {:tool_call_delta, json} |
content_block_start + tool_use | {:tool_call_delta, %{"id" => ..., "name" => ...}} |
message_delta with stop_reason | {:finish, reason} |
message_start, content_block_stop, message_stop | {:unknown, ...} |
{:stream_done, reason} | {:finish, reason} |
Error with "type" => "error" | {:error, message} |