Skip to content

Commit 9b054e2

Browse files
authored
Document updates for #513 (#514)
1 parent de9bd6f commit 9b054e2

File tree

4 files changed

+31
-48
lines changed

4 files changed

+31
-48
lines changed

docs/src/content/docs/guides/models.mdx

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import modelSettingsExample from '../../../../../examples/docs/models/modelSetti
1010
import promptIdExample from '../../../../../examples/basic/prompt-id.ts?raw';
1111
import agentWithModelExample from '../../../../../examples/docs/models/agentWithModel.ts?raw';
1212
import runnerWithModelExample from '../../../../../examples/docs/models/runnerWithModel.ts?raw';
13+
import gpt5DefaultModelSettingsExample from '../../../../../examples/docs/models/gpt5DefaultModelSettings.ts?raw';
1314
import setTracingExportApiKeyExample from '../../../../../examples/docs/config/setTracingExportApiKey.ts?raw';
1415

1516
Every Agent ultimately calls an LLM. The SDK abstracts models behind two lightweight
@@ -54,22 +55,11 @@ Second, you can set a default model for a `Runner` instance. If you don't set a
5455

5556
When you use any of GPT-5's reasoning models ([`gpt-5`](https://platform.openai.com/docs/models/gpt-5), [`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini), or [`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano)) this way, the SDK applies sensible `modelSettings` by default. Specifically, it sets both `reasoning.effort` and `verbosity` to `"low"`. To adjust the reasoning effort for the default model, pass your own `modelSettings`:
5657

57-
```ts
58-
import { Agent } from '@openai/agents';
59-
60-
const myAgent = new Agent({
61-
name: 'My Agent',
62-
instructions: "You're a helpful agent.",
63-
modelSettings: {
64-
providerData: {
65-
reasoning: { effort: 'minimal' },
66-
text: { verbosity: 'low' },
67-
},
68-
// If OPENAI_DEFAULT_MODEL=gpt-5 is set, passing only modelSettings works.
69-
// It's also fine to pass a GPT-5 model name explicitly:
70-
// model: 'gpt-5',
71-
});
72-
```
58+
<Code
59+
lang="typescript"
60+
code={gpt5DefaultModelSettingsExample}
61+
title="Customize GPT-5 default settings"
62+
/>
7363

7464
For lower latency, using either [`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini) or [`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano) with `reasoning.effort="minimal"` will often return responses faster than the default settings. However, some built-in tools (such as file search and image generation) in Responses API do not support `"minimal"` reasoning effort, which is why this Agents SDK defaults to `"low"`.
7565

docs/src/content/docs/ja/guides/models.mdx

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import modelSettingsExample from '../../../../../../examples/docs/models/modelSe
1010
import promptIdExample from '../../../../../../examples/basic/prompt-id.ts?raw';
1111
import agentWithModelExample from '../../../../../../examples/docs/models/agentWithModel.ts?raw';
1212
import runnerWithModelExample from '../../../../../../examples/docs/models/runnerWithModel.ts?raw';
13+
import gpt5DefaultModelSettingsExample from '../../../../../../examples/docs/models/gpt5DefaultModelSettings.ts?raw';
1314
import setTracingExportApiKeyExample from '../../../../../../examples/docs/config/setTracingExportApiKey.ts?raw';
1415

1516
最終的にすべてのエージェントは LLM を呼び出します。SDK はモデルを 2 つの軽量インターフェースの背後に抽象化します:
@@ -50,22 +51,11 @@ node my-awesome-agent.js
5051

5152
この方法で GPT-5 の推論モデル([`gpt-5`](https://platform.openai.com/docs/models/gpt-5)[`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini)[`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano))を使用する場合、SDK はデフォルトで妥当な `modelSettings` を適用します。具体的には、`reasoning.effort``verbosity` の両方を `"low"` に設定します。デフォルトモデルの推論強度を調整するには、独自の `modelSettings` を指定します:
5253

53-
```ts
54-
import { Agent } from '@openai/agents';
55-
56-
const myAgent = new Agent({
57-
name: 'My Agent',
58-
instructions: "You're a helpful agent.",
59-
modelSettings: {
60-
providerData: {
61-
reasoning: { effort: 'minimal' },
62-
text: { verbosity: 'low' },
63-
},
64-
// If OPENAI_DEFAULT_MODEL=gpt-5 is set, passing only modelSettings works.
65-
// It's also fine to pass a GPT-5 model name explicitly:
66-
// model: 'gpt-5',
67-
});
68-
```
54+
<Code
55+
lang="typescript"
56+
code={gpt5DefaultModelSettingsExample}
57+
title="GPT-5 の既定設定をカスタマイズ"
58+
/>
6959

7060
より低レイテンシを求める場合、[`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini) または [`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano)`reasoning.effort="minimal"` を指定すると、デフォルト設定より高速に応答が返ることが多いです。ただし、Responses API の一部の組み込みツール(ファイル検索や画像生成など)は `"minimal"` の推論強度をサポートしないため、この Agents SDK ではデフォルトを `"low"` にしています。
7161

docs/src/content/docs/zh/guides/models.mdx

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import modelSettingsExample from '../../../../../../examples/docs/models/modelSe
1010
import promptIdExample from '../../../../../../examples/basic/prompt-id.ts?raw';
1111
import agentWithModelExample from '../../../../../../examples/docs/models/agentWithModel.ts?raw';
1212
import runnerWithModelExample from '../../../../../../examples/docs/models/runnerWithModel.ts?raw';
13+
import gpt5DefaultModelSettingsExample from '../../../../../../examples/docs/models/gpt5DefaultModelSettings.ts?raw';
1314
import setTracingExportApiKeyExample from '../../../../../../examples/docs/config/setTracingExportApiKey.ts?raw';
1415

1516
每个智能体最终都会调用一个 LLM。SDK 在两个轻量接口后面抽象了模型:
@@ -50,22 +51,11 @@ node my-awesome-agent.js
5051

5152
当您以这种方式使用任一 GPT-5 推理模型([`gpt-5`](https://platform.openai.com/docs/models/gpt-5)[`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini)[`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano))时,SDK 会默认应用合理的 `modelSettings`。具体来说,它会将 `reasoning.effort``verbosity` 都设为 `"low"`。若要为默认模型调整推理强度,请传入您自己的 `modelSettings`
5253

53-
```ts
54-
import { Agent } from '@openai/agents';
55-
56-
const myAgent = new Agent({
57-
name: 'My Agent',
58-
instructions: "You're a helpful agent.",
59-
modelSettings: {
60-
providerData: {
61-
reasoning: { effort: 'minimal' },
62-
text: { verbosity: 'low' },
63-
},
64-
// If OPENAI_DEFAULT_MODEL=gpt-5 is set, passing only modelSettings works.
65-
// It's also fine to pass a GPT-5 model name explicitly:
66-
// model: 'gpt-5',
67-
});
68-
```
54+
<Code
55+
lang="typescript"
56+
code={gpt5DefaultModelSettingsExample}
57+
title="自定义 GPT-5 默认设置"
58+
/>
6959

7060
为了降低延迟,使用 [`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini)[`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano) 并设置 `reasoning.effort="minimal"` 通常会比默认设置更快地返回响应。但需要注意,Responses API 中的一些内置工具(例如文件搜索与图像生成)不支持 `"minimal"` 推理强度,因此本 Agents SDK 默认使用 `"low"`
7161

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Agent } from '@openai/agents';
2+
3+
const myAgent = new Agent({
4+
name: 'My Agent',
5+
instructions: "You're a helpful agent.",
6+
modelSettings: {
7+
reasoning: { effort: 'minimal' },
8+
text: { verbosity: 'low' },
9+
},
10+
// If OPENAI_DEFAULT_MODEL=gpt-5 is set, passing only modelSettings works.
11+
// It's also fine to pass a GPT-5 model name explicitly:
12+
// model: 'gpt-5',
13+
});

0 commit comments

Comments
 (0)