UseDocumentation Index
Fetch the complete documentation index at: https://docs.opper.ai/llms.txt
Use this file to discover all available pages before exploring further.
opper.stream() instead of opper.call() to receive the response as a series of chunks instead of one final object. Good for showing output as it arrives in a UI.
opper.stream(...) returns a response whose result is the stream of chunks. Each chunk has a data payload, and text chunks carry a delta string.
Stream text
span_id; the rest carry a delta with the next piece of text. Over HTTP, the endpoint sends server-sent events.
With a schema
Pass anoutput_schema just like a regular call. The deltas stream the JSON as the model produces it. Accumulate them and parse the result once the stream finishes if you need the typed object.
Errors mid-stream
If a Guard rule rejects the output or the upstream model fails, the stream ends with an error. Wrap the iteration in atry/except (Python) or try/catch (TypeScript).
What’s next
Calls
The non-streaming version.
Schemas
Pydantic, JSON Schema, and media types.
Chat streaming
Token-level streaming for the Chat API.