Skip to content

Commit acfe05c

Browse files
authored
Tweak on documents (#507)
1 parent 41d4b08 commit acfe05c

File tree

14 files changed

+34
-33
lines changed

14 files changed

+34
-33
lines changed

docs/src/content/docs/extensions/ai-sdk.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Out of the box the Agents SDK works with OpenAI models through the Responses API
4141
4. Initialize an instance of the model to be used by the agent:
4242

4343
```typescript
44-
const model = aisdk(openai('o4-mini'));
44+
const model = aisdk(openai('gpt-5-mini'));
4545
```
4646

4747
</Steps>

docs/src/content/docs/extensions/twilio.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Using Realtime Agents with Twilio
2+
title: Connect Realtime Agents to Twilio
33
description: Connect your Agents SDK agents to Twilio to use voice agents
44
---
55

docs/src/content/docs/guides/agents.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ The rest of this page walks through every Agent feature in more detail.
3434
The `Agent` constructor takes a single configuration object. The most commonly‑used
3535
properties are shown below.
3636

37-
| Property | Required | Description |
38-
| --------------- | -------- | ------------------------------------------------------------------------------------------------------- |
39-
| `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.). |
43-
| `tools` | no | Array of [`Tool`](/openai-agents-js/openai/agents/type-aliases/tool/) instances the model can call. |
37+
| Property | Required | Description |
38+
| --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
39+
| `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. |
4444

4545
<Code lang="typescript" code={agentWithTools} title="Agent with tools" />
4646

@@ -118,7 +118,7 @@ Both synchronous and `async` functions are supported.
118118

119119
## Lifecycle hooks
120120

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).
122122

123123
<Code
124124
lang="typescript"

docs/src/content/docs/guides/config.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,26 @@ Finally you can switch between the Responses API and the Chat Completions API.
3535

3636
## Tracing
3737

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()`:
3941

4042
<Code
4143
lang="typescript"
4244
code={setTracingExportApiKeyExample}
4345
title="Set tracing export API key"
4446
/>
4547

46-
Tracing can also be disabled entirely.
48+
Tracing can also be disabled entirely:
4749

4850
<Code
4951
lang="typescript"
5052
code={setTracingDisabledExample}
5153
title="Disable tracing"
5254
/>
5355

56+
If you’d like to learn more about the tracing feature, please check out [Tracing guide](/openai-agents-js/guides/tracing).
57+
5458
## Debug logging
5559

5660
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.

docs/src/content/docs/guides/running-agents.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ If you are creating your own `Runner` instance, you can pass in a `RunConfig` ob
8585

8686
## Conversations / chat threads
8787

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.
9189

9290
<Code
9391
lang="typescript"

docs/src/content/docs/guides/tools.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ raw JSON schema:
7575

7676
## 3. Agents as tools
7777

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()`:
8079

8180
<Code lang="typescript" code={agentsAsToolsExample} title="Agents as tools" />
8281

@@ -86,16 +85,18 @@ Under the hood the SDK:
8685
- Runs the sub‑agent with that input when the tool is called.
8786
- Returns either the last message or the output extracted by `customOutputExtractor`.
8887

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+
8990
---
9091

91-
## 4. Local MCP servers
92+
## 4. MCP servers
9293

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:
9596

9697
<Code lang="typescript" code={mcpLocalServer} title="Local MCP server" />
9798

98-
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.
99100

100101
---
101102

docs/src/content/docs/guides/voice-agents/build.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Similarly to regular agents, you can use handoffs to break your agent into multi
5555

5656
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.
5757

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).
5959

6060
## Tools
6161

examples/docs/agents/agentCloning.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Agent } from '@openai/agents';
33
const pirateAgent = new Agent({
44
name: 'Pirate',
55
instructions: 'Respond like a pirate – lots of “Arrr!”',
6-
model: 'o4-mini',
6+
model: 'gpt-5-mini',
77
});
88

99
const robotAgent = pirateAgent.clone({

examples/docs/agents/agentWithDynamicInstructions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interface UserContext {
55
}
66

77
function buildInstructions(runContext: RunContext<UserContext>) {
8-
return `The user's name is ${runContext.context.name}. Be extra friendly!`;
8+
return `The user's name is ${runContext.context.name}. Be extra friendly!`;
99
}
1010

1111
const agent = new Agent<UserContext>({

examples/docs/agents/agentWithHandoffs.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ const refundAgent = new Agent({
1313
// Use Agent.create method to ensure the finalOutput type considers handoffs
1414
const triageAgent = Agent.create({
1515
name: 'Triage Agent',
16-
instructions: [
17-
'Help the user with their questions.',
18-
'If the user asks about booking, hand off to the booking agent.',
19-
'If the user asks about refunds, hand off to the refund agent.',
20-
].join('\n'),
16+
instructions: `Help the user with their questions.
17+
If the user asks about booking, hand off to the booking agent.
18+
If the user asks about refunds, hand off to the refund agent.`.trimStart(),
2119
handoffs: [bookingAgent, refundAgent],
2220
});

0 commit comments

Comments
 (0)