Skip to content

Function: toSSE()

@providerprotocol/ai


@providerprotocol/ai / proxy/server / toSSE

toSSE(stream): Response

Defined in: src/providers/proxy/server/webapi.ts:254

Create an SSE Response from a StreamResult.

Streams PP StreamEvents as SSE, then sends the final Turn data.

StreamResult

The StreamResult from instance.stream()

Response

HTTP Response with SSE body

const stream = instance.stream(messages);
return toSSE(stream);