Skip to content

basalt / ai/src / SseResponse

Interface: SseResponse ​

Defined in: ai/src/provider/sse.ts:10

Minimal Server-Sent-Events support for OpenAI-compatible streaming.

Some gateways (e.g. go4ai) return a spurious 500 when they buffer a long non-streaming completion, even though the model generated it (and charged for it). Streaming sidesteps that: the response is delivered in chunks, so there's no large buffered body to choke on.

Properties ​

chunks ​

> chunks: AsyncIterable<string>

Defined in: ai/src/provider/sse.ts:16

Decoded text pieces of the streaming body.


ok ​

> ok: boolean

Defined in: ai/src/provider/sse.ts:11


status ​

> status: number

Defined in: ai/src/provider/sse.ts:12

Methods ​

text() ​

> text(): Promise<string>

Defined in: ai/src/provider/sse.ts:14

Full body — used for the error message on a non-2xx.

Returns ​

Promise<string>

Released under the MIT License.