Client APIs

openai_stream_events

Composes the current IRR execution into one logical Responses stream.

Praxis AI v0.12.1 (alpha) 2 min read
On this page

Composes the current IRR execution into one logical Responses stream.

Configuration Notes

Must run inside an iterative_request_router step. Running it elsewhere is a misconfiguration and fails closed at request time. Place it after load_balancer so IRR body hooks run with a selected peer when needed. timeout_secs is an absolute deadline from the first SSE chunk; each chunk recaps that absolute cutoff onto the live body through [praxis_filter::HttpFilterContext::cap_stream_deadline].

All fields are optional; omitted values fall back to [SseParserConfig] defaults.

Configuration

FieldTypeRequiredDescription
max_buffer_bytesintegernoMaximum bytes buffered for incomplete SSE lines/data across chunk boundaries. Default: 10 MiB.
max_eventsintegernoMaximum number of SSE events before the parser errors. Default: 100,000.
timeout_secsintegernoMaximum seconds from the first SSE chunk to stream completion. The parser enforces this absolute deadline when chunks or end-of-stream arrive. Before the first chunk, cluster read_timeout_ms applies; timeout_secs does not start until the first SSE chunk. Each later chunk calls [praxis_filter::HttpFilterContext::cap_stream_deadline] with the absolute cutoff so downstream backpressure cannot restart a relative per-read timer past the deadline. A tighter cluster read_timeout_ms is left in place. Default: 300 (5 minutes).
max_tool_call_argument_bytesintegernoMaximum bytes accepted per function-call argument string from function_call_arguments.delta or function_call_arguments.done events. Default: 1 MiB.
max_accumulated_bytesintegernoMaximum aggregate bytes accumulated across streaming output items and function-call argument buffers before the stream fails closed. Bounds total process memory even when every individual event is within max_buffer_bytes. Default: 64 MiB.
max_output_itemsintegernoMaximum number of streaming output items accumulated before the stream fails closed. Default: 100,000.

Example

filter: openai_stream_events
# All fields optional:
# max_buffer_bytes: 10485760
# max_events: 100000
# timeout_secs: 300
# max_tool_call_argument_bytes: 1048576
# max_accumulated_bytes: 67108864
# max_output_items: 100000