effect-io-ai

Package: @effect/ai-openai
Module: OpenAiClient

OpenAiClient.OpenAiSocket

Service for creating OpenAI response streams over a WebSocket connection.

When to use

Use when you need direct access to the WebSocket-backed response streaming service rather than wrapping an effect with WebSocket mode.

Details

createResponseStream sends a response.create message over the WebSocket connection and returns an HTTP response together with a stream of ResponseStreamEvent values.

Gotchas

WebSocket response streams are serialized to one request at a time by the shared socket service.

See

Signature

declare class OpenAiSocket

Source

Since v4.0.0