Skip to content

Commit 4902b07

Browse files
authored
docs: improve documentation entry points and navigation (#2578)
1 parent 6b90ab3 commit 4902b07

File tree

7 files changed

+60
-10
lines changed

7 files changed

+60
-10
lines changed

docs/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Configuring the SDK
1+
# Configuration
22

33
This page covers SDK-wide defaults that you usually set once during application startup, such as the default OpenAI key or client, the default OpenAI API shape, tracing export defaults, and logging behavior.
44

docs/index.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,20 @@ export OPENAI_API_KEY=sk-...
5858
## Start here
5959

6060
- Build your first text-based agent with the [Quickstart](quickstart.md).
61-
- Build a low-latency voice agent with the [Realtime agents quickstart](realtime/quickstart.md).
62-
- If you want a speech-to-text / agent / text-to-speech pipeline instead, see the [Voice pipeline quickstart](voice/quickstart.md).
61+
- Then decide how you want to carry state across turns in [Running agents](running_agents.md#choose-a-memory-strategy).
62+
- If you are deciding between handoffs and manager-style orchestration, read [Agent orchestration](multi_agent.md).
63+
64+
## Choose your path
65+
66+
Use this table when you know the job you want to do, but not which page explains it.
67+
68+
| Goal | Start here |
69+
| --- | --- |
70+
| Build the first text agent and see one complete run | [Quickstart](quickstart.md) |
71+
| Add function tools, hosted tools, or agents as tools | [Tools](tools.md) |
72+
| Decide between handoffs and manager-style orchestration | [Agent orchestration](multi_agent.md) |
73+
| Keep memory across turns | [Running agents](running_agents.md#choose-a-memory-strategy) and [Sessions](sessions/index.md) |
74+
| Use OpenAI models, websocket transport, or non-OpenAI providers | [Models](models/index.md) |
75+
| Review outputs, run items, interruptions, and resume state | [Results](results.md) |
76+
| Build a low-latency voice agent | [Realtime agents quickstart](realtime/quickstart.md) |
77+
| Build a speech-to-text / agent / text-to-speech pipeline | [Voice pipeline quickstart](voice/quickstart.md) |

docs/quickstart.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ if __name__ == "__main__":
6868

6969
For a second turn, you can either pass `result.to_input_list()` back into `Runner.run(...)`, attach a [session](sessions/index.md), or reuse OpenAI server-managed state with `conversation_id` / `previous_response_id`. The [running agents](running_agents.md) guide compares these approaches.
7070

71+
Use this rule of thumb:
72+
73+
| If you want... | Start with... |
74+
| --- | --- |
75+
| Full manual control and provider-agnostic history | `result.to_input_list()` |
76+
| The SDK to load and save history for you | [`session=...`](sessions/index.md) |
77+
| OpenAI-managed server-side continuation | `previous_response_id` or `conversation_id` |
78+
79+
For the tradeoffs and exact behaviors, see [Running agents](running_agents.md#choose-a-memory-strategy).
80+
7181
## Give your agent tools
7282

7383
You can give an agent tools to look up information or perform actions.
@@ -104,6 +114,13 @@ if __name__ == "__main__":
104114

105115
## Add a few more agents
106116

117+
Before you choose a multi-agent pattern, decide who should own the final answer:
118+
119+
- **Handoffs**: a specialist takes over the conversation for that part of the turn.
120+
- **Agents as tools**: an orchestrator stays in control and calls specialists as tools.
121+
122+
This quickstart continues with **handoffs** because it is the shortest first example. For the manager-style pattern, see [Agent orchestration](multi_agent.md) and [Tools: agents as tools](tools.md#agents-as-tools).
123+
107124
Additional agents can be defined in the same way. `handoff_description` gives the routing agent extra context about when to delegate.
108125

109126
```python

docs/results.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Most applications only need a few result properties or helpers:
1818
| `new_items` | Rich run items with agent, tool, and handoff metadata for logs, UIs, or audits. |
1919
| `last_agent` | The agent that should usually handle the next turn. |
2020
| `last_response_id` | Continuation with `previous_response_id` on the next OpenAI Responses turn. |
21+
| `agent_tool_invocation` | Metadata about the outer tool call when this result came from `Agent.as_tool()`. |
2122
| `interruptions` | Pending tool approvals you must resolve before resuming. |
2223
| `to_state()` | A serializable snapshot for pause/resume or durable job workflows. |
2324

@@ -63,6 +64,16 @@ The [`new_items`][agents.result.RunResultBase.new_items] property contains the n
6364

6465
Call [`result.to_state()`][agents.result.RunResult.to_state] when you need a serializable snapshot of the run. This is the bridge between a finished or paused run and a later resume, especially for approval flows or durable worker systems.
6566

67+
## Agent-as-tool metadata
68+
69+
When a result comes from a nested [`Agent.as_tool()`][agents.agent.Agent.as_tool] run, [`agent_tool_invocation`][agents.result.RunResultBase.agent_tool_invocation] exposes immutable metadata about the outer tool call:
70+
71+
- `tool_name`
72+
- `tool_call_id`
73+
- `tool_arguments`
74+
75+
For ordinary top-level runs, `agent_tool_invocation` is `None`.
76+
6677
## Other information
6778

6879
### Guardrail results
@@ -110,4 +121,5 @@ approval workflows, see the [human-in-the-loop guide](human_in_the_loop.md).
110121

111122
- [`final_output_as(...)`][agents.result.RunResultBase.final_output_as] casts final output to a specific type (optionally with runtime type checking).
112123
- [`last_response_id`][agents.result.RunResultBase.last_response_id] returns the latest model response ID. Pass this back as `previous_response_id` when you want to continue an OpenAI Responses API chain on the next turn.
124+
- [`agent_tool_invocation`][agents.result.RunResultBase.agent_tool_invocation] returns metadata about the outer tool call when the result comes from `Agent.as_tool()`.
113125
- [`release_agents(...)`][agents.result.RunResultBase.release_agents] drops strong references to agents when you want to reduce memory pressure after inspecting results.

docs/tools.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,11 @@ json_tool = data_agent.as_tool(
577577
)
578578
```
579579

580+
Inside a custom extractor, the nested [`RunResult`][agents.result.RunResult] also exposes
581+
[`agent_tool_invocation`][agents.result.RunResultBase.agent_tool_invocation], which is useful when
582+
you need the outer tool name, call ID, or raw arguments while post-processing the nested result.
583+
See the [Results guide](results.md#agent-as-tool-metadata).
584+
580585
### Streaming nested agent runs
581586

582587
Pass an `on_stream` callback to `as_tool` to listen to streaming events emitted by the nested agent while still returning its final output once the stream completes.

docs/tracing.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ The Agents SDK includes built-in tracing, collecting a comprehensive record of e
44

55
!!!note
66

7-
Tracing is enabled by default. There are two ways to disable tracing:
7+
Tracing is enabled by default. You can disable it in three common ways:
88

99
1. You can globally disable tracing by setting the env var `OPENAI_AGENTS_DISABLE_TRACING=1`
10-
2. You can disable tracing for a single run by setting [`agents.run.RunConfig.tracing_disabled`][] to `True`
10+
2. You can globally disable tracing in code with [`set_tracing_disabled(True)`][agents.set_tracing_disabled]
11+
3. You can disable tracing for a single run by setting [`agents.run.RunConfig.tracing_disabled`][] to `True`
1112

1213
***For organizations operating under a Zero Data Retention (ZDR) policy using OpenAI's APIs, tracing is unavailable.***
1314

mkdocs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ plugins:
5353
nav:
5454
- Intro: index.md
5555
- Quickstart: quickstart.md
56-
- config.md
56+
- Configuration: config.md
5757
- Documentation:
58-
- multi_agent.md
5958
- agents.md
6059
- Models:
6160
- models/index.md
@@ -64,6 +63,7 @@ plugins:
6463
- guardrails.md
6564
- running_agents.md
6665
- streaming.md
66+
- multi_agent.md
6767
- handoffs.md
6868
- results.md
6969
- human_in_the_loop.md
@@ -174,7 +174,6 @@ plugins:
174174
- クイックスタート: quickstart.md
175175
- config.md
176176
- ドキュメント:
177-
- multi_agent.md
178177
- agents.md
179178
- モデル:
180179
- models/index.md
@@ -183,6 +182,7 @@ plugins:
183182
- guardrails.md
184183
- running_agents.md
185184
- streaming.md
185+
- multi_agent.md
186186
- handoffs.md
187187
- results.md
188188
- human_in_the_loop.md
@@ -214,7 +214,6 @@ plugins:
214214
- 빠른 시작: quickstart.md
215215
- config.md
216216
- 문서:
217-
- multi_agent.md
218217
- agents.md
219218
- 모델:
220219
- models/index.md
@@ -223,6 +222,7 @@ plugins:
223222
- guardrails.md
224223
- running_agents.md
225224
- streaming.md
225+
- multi_agent.md
226226
- handoffs.md
227227
- results.md
228228
- human_in_the_loop.md
@@ -254,7 +254,6 @@ plugins:
254254
- 快速开始: quickstart.md
255255
- config.md
256256
- 文档:
257-
- multi_agent.md
258257
- agents.md
259258
- 模型:
260259
- models/index.md
@@ -263,6 +262,7 @@ plugins:
263262
- guardrails.md
264263
- running_agents.md
265264
- streaming.md
265+
- multi_agent.md
266266
- handoffs.md
267267
- results.md
268268
- human_in_the_loop.md

0 commit comments

Comments
 (0)