View Source Anthropic.Messages.StreamEvent (anthropic_community v0.5.0)

Decodes a raw SSE frame ({event_name, data}, as produced by Anthropic.HTTPTransport.SSE) into a typed event struct. See Anthropic.Messages.StreamAccumulator for folding a stream of these into a final Anthropic.Messages.Message.

Summary

Functions

Decodes one raw SSE frame's data field into a typed event. event_name is accepted for parity with the SSE frame shape but the wire "type" field inside data is authoritative.

Types

Functions

Link to this function

decode(event_name, data)

View Source
@spec decode(event_name :: String.t() | nil, data :: String.t()) :: t()

Decodes one raw SSE frame's data field into a typed event. event_name is accepted for parity with the SSE frame shape but the wire "type" field inside data is authoritative.