v2026.4.1
All Bundles

SSEEvent

Server-Sent Event (SSE) data. Represents a single event from an SSE stream (text/event-stream). Used with LLM APIs (OpenAI, Claude, Gemini) for streaming responses.

Operations

GetData

Gets the event data (from "data:" field)

method : public : GetData() ~ String

Return

TypeDescription
Stringevent data

GetEvent

Gets the event type (from "event:" field, or "message" by default)

method : public : GetEvent() ~ String

Return

TypeDescription
Stringevent type

GetId

Gets the event ID (from "id:" field, may be Nil)

method : public : GetId() ~ String

Return

TypeDescription
Stringevent id

IsDone

Checks if this is the stream termination signal (data is "[DONE]")

method : public : IsDone() ~ Bool

Return

TypeDescription
Booltrue if done

New

Constructor

New(event:String, data:String, id:String)

Parameters

NameTypeDescription
eventStringevent type
dataStringevent data
idStringevent id

ToString

String representation

method : public : ToString() ~ String

Return

TypeDescription
Stringstring