You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`name`| yes | A short human‑readable identifier. |
40
+
|`instructions`| yes | System prompt (string **or** function – see [Dynamic instructions](#dynamic-instructions)). |
41
+
|`model`| no | Model name **or** a custom [`Model`](/openai-agents-js/openai/agents/interfaces/model/) implementation. |
42
+
|`modelSettings`| no | Tuning parameters (temperature, top_p, etc.). If the properties you need aren’t at the top level, you can include them under `providerData`.|
43
+
|`tools`| no | Array of [`Tool`](/openai-agents-js/openai/agents/type-aliases/tool/) instances the model can call. |
44
44
45
45
<Codelang="typescript"code={agentWithTools}title="Agent with tools" />
46
46
@@ -118,7 +118,7 @@ Both synchronous and `async` functions are supported.
118
118
119
119
## Lifecycle hooks
120
120
121
-
For advanced use‑cases you can observe the Agent lifecycle by listening on events
121
+
For advanced use‑cases you can observe the Agent lifecycle by listening on events. To learn what's available, refer to agent hook event names listed [here](https://github.com/openai/openai-agents-js/blob/main/packages/agents-core/src/lifecycle.ts).
Copy file name to clipboardExpand all lines: docs/src/content/docs/guides/config.mdx
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,22 +35,26 @@ Finally you can switch between the Responses API and the Chat Completions API.
35
35
36
36
## Tracing
37
37
38
-
Tracing is enabled by default and uses the OpenAI key from the section above. A separate key may be set via `setTracingExportApiKey()`.
38
+
Tracing is enabled by default and uses the OpenAI key from the section above.
39
+
40
+
A separate key may be set via `setTracingExportApiKey()`:
39
41
40
42
<Code
41
43
lang="typescript"
42
44
code={setTracingExportApiKeyExample}
43
45
title="Set tracing export API key"
44
46
/>
45
47
46
-
Tracing can also be disabled entirely.
48
+
Tracing can also be disabled entirely:
47
49
48
50
<Code
49
51
lang="typescript"
50
52
code={setTracingDisabledExample}
51
53
title="Disable tracing"
52
54
/>
53
55
56
+
If you’d like to learn more about the tracing feature, please check out [Tracing guide](/openai-agents-js/guides/tracing).
57
+
54
58
## Debug logging
55
59
56
60
The SDK uses the [`debug`](https://www.npmjs.com/package/debug) package for debug logging. Set the `DEBUG` environment variable to `openai-agents*` to see verbose logs.
Copy file name to clipboardExpand all lines: docs/src/content/docs/guides/running-agents.mdx
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,9 +85,7 @@ If you are creating your own `Runner` instance, you can pass in a `RunConfig` ob
85
85
86
86
## Conversations / chat threads
87
87
88
-
Each call to `runner.run()` (or `run()` utility) represents one **turn** in your application-level conversation. You
89
-
choose how much of the `RunResult` you show the end‑user – sometimes only `finalOutput`, other
90
-
times every generated item.
88
+
Each call to `runner.run()` (or `run()` utility) represents one **turn** in your application-level conversation. You choose how much of the `RunResult` you show the end‑user – sometimes only `finalOutput`, other times every generated item.
Copy file name to clipboardExpand all lines: docs/src/content/docs/guides/tools.mdx
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,8 +75,7 @@ raw JSON schema:
75
75
76
76
## 3. Agents as tools
77
77
78
-
Sometimes you want an Agent to _assist_ another Agent without fully handing off the
79
-
conversation. Use `agent.asTool()`:
78
+
Sometimes you want an Agent to _assist_ another Agent without fully handing off the conversation. Use `agent.asTool()`:
80
79
81
80
<Codelang="typescript"code={agentsAsToolsExample}title="Agents as tools" />
82
81
@@ -86,16 +85,18 @@ Under the hood the SDK:
86
85
- Runs the sub‑agent with that input when the tool is called.
87
86
- Returns either the last message or the output extracted by `customOutputExtractor`.
88
87
88
+
When you run an agent as a tool, Agents SDK creates a runner with the defualt settings and run the agent with it within the function execution. If you want to provide any properties of `runConfig` or `runOptions`, you can pass them to the `asTool()` method to customize the runner's behavior.
89
+
89
90
---
90
91
91
-
## 4. Local MCP servers
92
+
## 4. MCP servers
92
93
93
-
You can expose tools via a local [Model Context Protocol](https://modelcontextprotocol.io/)server and attach them to an agent.
94
-
Use `MCPServerStdio` to spawn and connect to the server:
94
+
You can expose tools via [Model Context Protocol (MCP)](https://modelcontextprotocol.io/)servers and attach them to an agent.
95
+
For instance, you can use `MCPServerStdio` to spawn and connect to the stdio MCP server:
See [`filesystem-example.ts`](https://github.com/openai/openai-agents-js/tree/main/examples/mcp/filesystem-example.ts) for a complete example.
99
+
See [`filesystem-example.ts`](https://github.com/openai/openai-agents-js/tree/main/examples/mcp/filesystem-example.ts) for a complete example. Also, if you're looking for a comprehensitve guide for MCP server tool integration, refer to [MCP guide](/openai-agents-js/guides/mcp) for details.
Copy file name to clipboardExpand all lines: docs/src/content/docs/guides/voice-agents/build.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ Similarly to regular agents, you can use handoffs to break your agent into multi
55
55
56
56
Unlike regular agents, handoffs behave slightly differently for Realtime Agents. When a handoff is performed, the ongoing session will be updated with the new agent configuration. Because of this, the agent automatically has access to the ongoing conversation history and input filters are currently not applied.
57
57
58
-
Additionally, this means that the `voice` or `model` cannot be changed as part of the handoff. You can also only connect to other Realtime Agents. If you need to use a different model, for example a reasoning model like `o4-mini`, you can use [delegation through tools](#delegation-through-tools).
58
+
Additionally, this means that the `voice` or `model` cannot be changed as part of the handoff. You can also only connect to other Realtime Agents. If you need to use a different model, for example a reasoning model like `gpt-5-mini`, you can use [delegation through tools](#delegation-through-tools).
0 commit comments