Skip to content

Commit e43b5c6

Browse files
authored
docs: update docs to reflect recent changes (#960)
1 parent 0b1ebea commit e43b5c6

File tree

5 files changed

+26
-8
lines changed

5 files changed

+26
-8
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Out of the box the Agents SDK works with OpenAI models through the Responses API
3535

3636
```typescript
3737
import { openai } from '@ai-sdk/openai';
38-
import { aisdk } from '@openai/agents-extensions';
38+
import { aisdk } from '@openai/agents-extensions/ai-sdk';
3939
```
4040

4141
4. Initialize an instance of the model to be used by the agent:
@@ -47,9 +47,9 @@ Out of the box the Agents SDK works with OpenAI models through the Responses API
4747
</Steps>
4848

4949
<Aside type="caution">
50-
We currently support ai-sdk's model provider v2 modules, which are compatible
51-
with Vercel AI SDK v5. If you have a specific reason to continue using the v1
52-
model providers, you can copy the module from
50+
We support AI SDK providers that expose `specificationVersion` `v2` or `v3`.
51+
If you have a specific reason to continue using the older v1 provider style,
52+
you can copy the module from
5353
[examples/ai-sdk-v1](https://github.com/openai/openai-agents-js/tree/main/examples/ai-sdk-v1)
5454
and include it in your project.
5555
</Aside>

docs/src/content/docs/guides/mcp.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ await using mcpServers = await connectMcpServers(servers);
206206
For **Streamable HTTP** and **Stdio** servers, each time an `Agent` runs it may call `list_tools()` to discover available tools. Because that round‑trip can add latency—especially to remote servers—you can cache the results in memory by passing `cacheToolsList: true` to `MCPServerStdio` or `MCPServerStreamableHttp`.
207207

208208
Only enable this if you're confident the tool list won't change. To invalidate the cache later, call `invalidateToolsCache()` on the server instance.
209+
If you are using shared MCP tool caching via `getAllMcpTools(...)`, you can also invalidate by server name with `invalidateServerToolsCache(serverName)`.
210+
211+
For advanced cases, `getAllMcpTools({ generateMCPToolCacheKey })` lets you customize cache partitioning (for example, by server + agent + run context).
209212

210213
### Tool filtering
211214

docs/src/content/docs/guides/sessions.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ Reusing the same session instance ensures the agent receives the full conversati
4646
| `organization` | `string` | OpenAI organization ID for requests. |
4747
| `project` | `string` | OpenAI project ID for requests. |
4848

49+
If you need to pre-create a conversation ID before constructing the session, use
50+
`startOpenAIConversationsSession(client?)` and pass the returned ID as `conversationId`.
51+
4952
---
5053

5154
## How the runner uses sessions

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,28 @@ for advanced options like `rankingOptions` or semantic filters.
4949
Local built-in tools run in your own environment and require you to supply implementations:
5050

5151
- **Computer use** – implement the `Computer` interface and pass it to `computerTool()`.
52-
- **Shell**implement the `Shell` interface and pass it to `shellTool()`.
52+
- **Shell**either provide a local `Shell` implementation, or configure a hosted container environment.
5353
- **Apply patch** – implement the `Editor` interface and pass it to `applyPatchTool()`.
5454

55-
These tools execute locally and are **not** hosted by OpenAI. Use them when you need direct access
56-
to files, terminals, or GUI automation in your runtime. The tool calls are still requested by the
57-
OpenAI model’s responses, but your application is expected to execute them locally.
55+
Computer and apply-patch tools execute locally and are **not** hosted by OpenAI. Shell tools can run
56+
locally or in hosted container environments, depending on `shellTool()` configuration.
57+
The tool calls are still requested by the model’s responses, but your application controls how those
58+
calls are executed.
5859

5960
<Code
6061
lang="typescript"
6162
code={localBuiltInToolsExample}
6263
title="Local built-in tools"
6364
/>
6465

66+
For hosted shell environments, configure `shellTool({ environment })` with either:
67+
68+
- `type: 'container_auto'` to create a managed container for the run (supports network policy, memory limit, and skills).
69+
- `type: 'container_reference'` to reuse an existing container by `containerId`.
70+
71+
See `examples/tools/container-shell-skill-ref.ts` and `examples/tools/container-shell-inline-skill.ts`
72+
for end-to-end usage.
73+
6574
---
6675

6776
## 3. Function tools

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ Hosted MCP tools can be configured with `hostedMcpTool` and are executed remotel
8484

8585
While the tool is executing the agent will not be able to process new requests from the user. One way to improve the experience is by telling your agent to announce when it is about to execute a tool or say specific phrases to buy the agent some time to execute the tool.
8686

87+
If a function tool should finish without immediately triggering another model response, return `backgroundResult(output)` from `@openai/agents/realtime`.
88+
This sends the tool output back to the session while leaving response triggering under your control.
89+
8790
### Accessing the conversation history
8891

8992
Additionally to the arguments that the agent called a particular tool with, you can also access a snapshot of the current conversation history that is tracked by the Realtime Session. This can be useful if you need to perform a more complex action based on the current state of the conversation or are planning to use [tools for delegation](#delegation-through-tools).

0 commit comments

Comments
 (0)