Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 01_ai_agents_first/15_run_lifecycle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ These two layers allow for both a broad view of the system's execution (through

## Run LifeCycle in the OpenAI Agents SDK

In the SDK, the **run lifecycle** is managed through **RunHooks**. These hooks allow you to observe and control events that occur across the entire run of one or more agents. They include callbacks for when an agent starts or ends, when a tool is about to run, and when control is handed off between agents. You can add callbacks on these (lifecycle events)[https://openai.github.io/openai-agents-python/ref/lifecycle/#agents.lifecycle.RunHooks] in an agent run:
In the SDK, the **run lifecycle** is managed through **RunHooks**. These hooks allow you to observe and control events that occur across the entire run of one or more agents. They include callbacks for when an agent starts or ends, when a tool is about to run, and when control is handed off between agents. You can add callbacks on these [lifecycle events](https://openai.github.io/openai-agents-python/ref/lifecycle/#agents.lifecycle.RunHooks) in an agent run:

1. **on_agent_start async:** Called before the agent is invoked. Called each time the current agent changes.
2. **on_agent_end async:** Called when the agent produces a final output.
Expand Down Expand Up @@ -91,4 +91,4 @@ asyncio.run(main())
- https://openai.github.io/openai-agents-python/agents/#lifecycle-events-hooks
- https://openai.github.io/openai-agents-python/ref/run/#agents.run.Runner
- https://openai.github.io/openai-agents-python/ref/lifecycle/#agents.lifecycle.RunHooks
- https://openai.github.io/openai-agents-python/ref/lifecycle/#agents.lifecycle.AgentHooks
- https://openai.github.io/openai-agents-python/ref/lifecycle/#agents.lifecycle.AgentHooks