Skip to content

Add SSE/chunked streaming support to the SDK #26

@rickstaa

Description

@rickstaa

What

Add SSE / chunked streaming support to call_runner in the Python SDK, so callers can consume live runner responses incrementally instead of waiting for the full body.

  • http.open_stream() — opens an HTTP request and hands back the live (session, response) without reading the body. Caller owns both. No total timeout (streams run indefinitely); only connect/first-byte are bounded. Raises LivepeerHTTPError on >= 400.
  • LiveRunnerCallStream — returned by call_runner(..., stream=True). Owns the aiohttp session/response, is an async context manager (or call aclose()), and exposes the body via aiter_bytes() / aiter_lines() plus status/headers/content_type/runner.
  • Payment — streaming reuses the existing per-call 402 challenge/retry path; open_stream raises before any body, so the payment retry catches it exactly like the non-streaming path.
  • Export LiveRunnerCallStream from the package root.

Why

Live runner apps that stream output (token-by-token LLM responses, progressive media) need an incremental response path in the SDK, without standing up the trickle/lv2v continuous-payment flow. This SSE path is one job, one upfront payment.

Implementation

Implemented in #25 (builds on the live-runner work in #20).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions