Skip to main content
An async function executor can yield agent events followed by its final StepOutput.
step_with_function_streaming_agentos.py

Install

Set OpenAI Key

Set your OPENAI_API_KEY as an environment variable. You can get one from OpenAI.

Run

How it works

  1. stream_content_plan yields each RunOutputEvent from content_planner.arun().
  2. The workflow adds its run, session, and step context to those events.
  3. The function yields one StepOutput after the planner finishes.
  4. AgentOS exposes the workflow and its event stream through the runtime API.

Next steps