Skip to content

Commit c81af1a

Browse files
authored
Merge branch 'openai:main' into main
2 parents 1761401 + 017ad69 commit c81af1a

25 files changed

+920
-217
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,21 @@ Explore the [examples](examples) directory to see the SDK in action, and read ou
2020

2121
1. Set up your Python environment
2222

23-
```
23+
- Option A: Using venv (traditional method)
24+
```bash
2425
python -m venv env
25-
source env/bin/activate
26+
source env/bin/activate # On Windows: env\Scripts\activate
27+
```
28+
29+
- Option B: Using uv (recommended)
30+
```bash
31+
uv venv
32+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
2633
```
2734

2835
2. Install Agents SDK
2936

30-
```
37+
```bash
3138
pip install openai-agents
3239
```
3340

@@ -50,7 +57,7 @@ print(result.final_output)
5057

5158
(_If running this, ensure you set the `OPENAI_API_KEY` environment variable_)
5259

53-
(_For Jupyter notebook users, see [hello_world_jupyter.py](examples/basic/hello_world_jupyter.py)_)
60+
(_For Jupyter notebook users, see [hello_world_jupyter.ipynb](examples/basic/hello_world_jupyter.ipynb)_)
5461

5562
## Handoffs example
5663

docs/ja/mcp.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,20 @@ Agents SDK は MCP をサポートしており、これにより幅広い MCP
2323
たとえば、[公式 MCP filesystem サーバー](https://www.npmjs.com/package/@modelcontextprotocol/server-filesystem)を利用する場合は次のようになります。
2424

2525
```python
26+
from agents.run_context import RunContextWrapper
27+
2628
async with MCPServerStdio(
2729
params={
2830
"command": "npx",
2931
"args": ["-y", "@modelcontextprotocol/server-filesystem", samples_dir],
3032
}
3133
) as server:
32-
tools = await server.list_tools()
34+
# 注意:実際には通常は MCP サーバーをエージェントに追加し、
35+
# フレームワークがツール一覧の取得を自動的に処理するようにします。
36+
# list_tools() への直接呼び出しには run_context と agent パラメータが必要です。
37+
run_context = RunContextWrapper(context=None)
38+
agent = Agent(name="test", instructions="test")
39+
tools = await server.list_tools(run_context, agent)
3340
```
3441

3542
## MCP サーバーの利用

docs/ja/models.md

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)