org.llm4s.llmconnect.streaming.SSEParser
Server-Sent Events (SSE) parser for streaming LLM responses.
Handles the SSE format used by both OpenAI and Anthropic streaming endpoints. SSE format consists of fields like:
- data:
- event:
- id:
- retry:
- :
Attributes
-
Graph
-
-
Supertypes
-
class Object
trait Matchable
class Any
-
Self type
-
Members list
Represents a parsed SSE event
Represents a parsed SSE event
Attributes
-
Supertypes
-
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Parse streaming data with a buffer for incomplete events. This is useful for parsing data as it arrives from a network stream.
Parse streaming data with a buffer for incomplete events. This is useful for parsing data as it arrives from a network stream.
Attributes
-
Supertypes
-
class Object
trait Matchable
class Any
Create a new streaming parser instance
Create a new streaming parser instance
Attributes
Parse a single SSE event from a string. An event is terminated by a double newline.
Parse a single SSE event from a string. An event is terminated by a double newline.
Attributes
Parse a stream of SSE data into individual events. Returns an iterator of SSEEvents.
Parse a stream of SSE data into individual events. Returns an iterator of SSEEvents.
Attributes