Skip to content

PURISTA API


PURISTA API / @purista/ai / toProtocolSseEvents

Function: toProtocolSseEvents()

toProtocolSseEvents(envelopes, protocol): AsyncGenerator<ProtocolSseEvent>

Defined in: packages/ai/src/protocol/sse.ts:16

Converts PURISTA protocol envelopes to protocol-specific SSE events. This allows endpoint consumers to select an interoperable stream protocol without app-layer custom adapters.

Parameters

envelopes

object[]

protocol

"ai-sdk-responses" | "ai-sdk-ui-message" | "ai-sdk-data" | "ai-sdk-json-render" | "agent2agent" | "mcp"

Returns

AsyncGenerator<ProtocolSseEvent>