ONE is preparing: 01 / INITIALIZING MODEL ROUTER. Evaluating routing across providers.
Current state
01 / INITIALIZING MODEL ROUTER.

Evaluating routing across providers.

ONEDocs

Streaming responses

General considerations for progressively receiving and displaying a generated response.

Working scaffold: The transport, event names, and completion markers below are not defined for ONE. Confirm the supported streaming protocol before adding executable examples.

When streaming helps

Streaming can make a long-running response feel more responsive by delivering parts as they become available. It also changes how clients parse, render, cancel, and recover from a request.

Client responsibilities

  1. Enable streaming using the documented request option.
  2. Read the documented event or chunk format incrementally.
  3. Append only the expected content to the user-visible response.
  4. Detect completion, interruption, and error events.
  5. Release the connection and any reader resources when finished or cancelled.

The exact transport may be server-sent events, a streamed HTTP body, or another mechanism. Do not assume that chunks are complete words, JSON objects, or application messages.

Production considerations

Handle disconnects and cancellation; avoid buffering an unbounded response; and ensure that final usage or metadata is processed when the protocol provides it. Keep logs free of sensitive prompts and credentials.

On this page