|
2 | 2 |
|
3 | 3 | Agents are the core building block in your apps. An agent is a large language model (LLM) configured with instructions, tools, and optional runtime behavior such as handoffs, guardrails, and structured outputs. |
4 | 4 |
|
5 | | -Use this page when you want to define or customize a single plain `Agent`. If you are deciding how multiple agents should collaborate, read [Agent orchestration](multi_agent.md). If the agent should run inside an isolated workspace with manifest-defined files and sandbox-native capabilities, read [Sandbox agent concepts](sandbox/guide.md). |
| 5 | +Use this page when you want to define or customize a single base `Agent` rather than a `SandboxAgent`. If you are deciding how multiple agents should collaborate, read [Agent orchestration](multi_agent.md). If the agent should run inside an isolated workspace with manifest-defined files and sandbox-native capabilities, read [Sandbox agent concepts](sandbox/guide.md). |
6 | 6 |
|
7 | 7 | The SDK uses the Responses API by default for OpenAI models, but the distinction here is orchestration: `Agent` plus `Runner` lets the SDK manage turns, tools, guardrails, handoffs, and sessions for you. If you want to own that loop yourself, use the Responses API directly instead. |
8 | 8 |
|
@@ -35,8 +35,8 @@ The most common properties of an agent are: |
35 | 35 | | `model` | no | Which LLM to use. See [Models](models/index.md). | |
36 | 36 | | `model_settings` | no | Model tuning parameters such as `temperature`, `top_p`, and `tool_choice`. | |
37 | 37 | | `tools` | no | Tools the agent can call. See [Tools](tools.md). | |
38 | | -| `mcp_servers` | no | MCP-backed tools for the agent. See the [MCP guide](mcp.md). | |
39 | | -| `mcp_config` | no | Fine-tune how MCP tools are prepared, such as strict schema conversion and MCP failure formatting. See the [MCP guide](mcp.md#agent-level-mcp-configuration). | |
| 38 | +| `mcp_servers` | no | MCP servers that provide MCP-backed tools to the agent. See the [MCP guide](mcp.md). | |
| 39 | +| `mcp_config` | no | Fine-tune how MCP tools are prepared, such as converting their schemas to strict mode and formatting MCP failures. See the [MCP guide](mcp.md#agent-level-mcp-configuration). | |
40 | 40 | | `input_guardrails` | no | Guardrails that run on the first user input for this agent chain. See [Guardrails](guardrails.md). | |
41 | 41 | | `output_guardrails` | no | Guardrails that run on the final output for this agent. See [Guardrails](guardrails.md). | |
42 | 42 | | `output_type` | no | Structured output type instead of plain text. See [Output types](#output-types). | |
@@ -65,7 +65,7 @@ Everything in this section applies to `Agent`. `SandboxAgent` builds on the same |
65 | 65 |
|
66 | 66 | ## Prompt templates |
67 | 67 |
|
68 | | -You can reference a prompt template created in the OpenAI platform by setting `prompt`. This works with OpenAI models using the Responses API. |
| 68 | +You can reference a prompt template created in the OpenAI platform by setting `prompt`. This works when OpenAI models are accessed through the Responses API. |
69 | 69 |
|
70 | 70 | To use it, please: |
71 | 71 |
|
@@ -215,7 +215,7 @@ customer_facing_agent = Agent( |
215 | 215 |
|
216 | 216 | ### Handoffs |
217 | 217 |
|
218 | | -Handoffs are sub‑agents the agent can delegate to. When a handoff occurs, the delegated agent receives the conversation history and takes over the conversation. This pattern enables modular, specialized agents that excel at a single task. Read more in the [handoffs](handoffs.md) documentation. |
| 218 | +Configured handoff targets are sub‑agents to which the agent can delegate. When a handoff occurs, the delegated agent receives the conversation history and takes over the conversation. This pattern enables modular, specialized agents that excel at a single task. Read more in the [handoffs](handoffs.md) documentation. |
219 | 219 |
|
220 | 220 | ```python |
221 | 221 | from agents import Agent |
@@ -269,12 +269,12 @@ The callback context also changes depending on the event: |
269 | 269 |
|
270 | 270 | Typical hook timing: |
271 | 271 |
|
272 | | -- `on_agent_start` / `on_agent_end`: when a specific agent begins or finishes producing a final output. |
| 272 | +- `on_agent_start`: when a specific agent begins running; `on_agent_end`: when that agent finishes producing a final output. |
273 | 273 | - `on_llm_start` / `on_llm_end`: immediately around each model call. |
274 | 274 | - `on_tool_start` / `on_tool_end`: around each local tool invocation. For function tools, the hook `context` is typically a `ToolContext`, so you can inspect tool-call metadata such as `tool_call_id`. |
275 | 275 | - `on_handoff`: when control moves from one agent to another. |
276 | 276 |
|
277 | | -Use `RunHooks` when you want a single observer for the whole workflow, and `AgentHooks` when one agent needs custom side effects. |
| 277 | +Use `RunHooks` when you want a single observer for the whole workflow, and `AgentHooks` when you want lifecycle callbacks scoped to a specific agent. |
278 | 278 |
|
279 | 279 | ```python |
280 | 280 | from agents import Agent, RunHooks, Runner |
@@ -396,7 +396,7 @@ agent = Agent( |
396 | 396 | ) |
397 | 397 | ``` |
398 | 398 |
|
399 | | -- `ToolsToFinalOutputFunction`: A custom function that processes tool results and decides whether to stop or continue with the LLM. |
| 399 | +- `ToolsToFinalOutputFunction`: A custom function that processes tool results and decides whether to end the run with a final output or continue processing with the LLM. |
400 | 400 |
|
401 | 401 | ```python |
402 | 402 | from agents import Agent, FunctionToolResult, RunContextWrapper |
|
0 commit comments