Summary
The OpenAI Python SDK's client.responses.stream() dedicated streaming helper is not instrumented by wrap_openai(). Calls to it fall through via NamedWrapper.__getattr__ to the unwrapped SDK, producing zero Braintrust tracing — no spans, no token metrics, no timing.
Only responses.create(stream=True) and responses.parse() are wrapped today.
What's missing
responses.stream() returns a high-level ResponseStream / AsyncResponseStream context manager that provides:
- Event-driven iteration with typed events and
.on("event_type", handler) callbacks
- Built-in accumulation via
.get_final_response() after stream completion
- Convenience helpers like
.text_stream (yields only text deltas) and .until_done()
- Context manager resource cleanup (
with client.responses.stream(...) as stream:)
This is the recommended streaming pattern in the OpenAI SDK docs and is distinct from the raw create(stream=True) iterator path that is already instrumented.
A parallel gap exists for chat.completions.stream() (tracked in #114). This issue covers the Responses API equivalent.
Braintrust docs status
The OpenAI integration page does not mention responses.stream(). Status: not_found.
Upstream sources
Local files inspected
py/src/braintrust/oai.py — ResponsesV1Wrapper (line 873) and AsyncResponsesV1Wrapper (line 892) define create() and parse() only; no stream() method
py/src/braintrust/wrappers/test_openai.py — no tests for responses.stream()
py/src/braintrust/wrappers/openai.py — re-exports from oai.py, no additional stream() handling
Summary
The OpenAI Python SDK's
client.responses.stream()dedicated streaming helper is not instrumented bywrap_openai(). Calls to it fall through viaNamedWrapper.__getattr__to the unwrapped SDK, producing zero Braintrust tracing — no spans, no token metrics, no timing.Only
responses.create(stream=True)andresponses.parse()are wrapped today.What's missing
responses.stream()returns a high-levelResponseStream/AsyncResponseStreamcontext manager that provides:.on("event_type", handler)callbacks.get_final_response()after stream completion.text_stream(yields only text deltas) and.until_done()with client.responses.stream(...) as stream:)This is the recommended streaming pattern in the OpenAI SDK docs and is distinct from the raw
create(stream=True)iterator path that is already instrumented.A parallel gap exists for
chat.completions.stream()(tracked in #114). This issue covers the Responses API equivalent.Braintrust docs status
The OpenAI integration page does not mention
responses.stream(). Status: not_found.Upstream sources
client.responses.stream()as a first-class helperLocal files inspected
py/src/braintrust/oai.py—ResponsesV1Wrapper(line 873) andAsyncResponsesV1Wrapper(line 892) definecreate()andparse()only; nostream()methodpy/src/braintrust/wrappers/test_openai.py— no tests forresponses.stream()py/src/braintrust/wrappers/openai.py— re-exports fromoai.py, no additionalstream()handling