MCPcopy
hub / github.com/openai/openai-agents-python / stream

Function stream

tests/fastapi/streaming_app.py:18–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17@app.post("/stream")
18async def stream():
19 result = Runner.run_streamed(agent, input="Tell me a joke")
20 stream_handler = StreamHandler(result)
21 return StreamingResponse(stream_handler.stream_events(), media_type="application/x-ndjson")
22
23
24class StreamHandler:

Callers

nothing calls this directly

Calls 3

stream_eventsMethod · 0.95
StreamHandlerClass · 0.85
run_streamedMethod · 0.45

Tested by

no test coverage detected