Skip to main content

Function: toStreamingResponse()

function toStreamingResponse(stream: AsyncGenerator<SessionState, any, unknown>, keepAliveDelay: number): Response

Generate a streaming response from a generator returned by client.runStream.

Parameters

ParameterTypeDescription

stream

AsyncGenerator<SessionState, any, unknown>

An async generator returned by client.runStream

keepAliveDelay

number

The delay in milliseconds to send keep-alive messages. Default is 1 minute.

Returns

Response

A streaming Response object