SseParser class

Server-Sent Events parser for Anthropic streaming API.

Conforms to the W3C EventSource spec:

  • Lines starting with "event:" set the event type.
  • Lines starting with "data:" append to the data buffer.
  • Lines starting with "id:" set the last-event-id.
  • Lines starting with "retry:" suggest a reconnection interval.
  • An empty line dispatches the accumulated event.
  • Lines starting with ":" are comments and are ignored.

Constructors

SseParser()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(Stream<List<int>> byteStream) Stream<SseEvent>
Transform a raw byte stream into a stream of SseEvents.
reset() → void
Reset parser state (useful between reconnections).
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited