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
Copy file name to clipboardExpand all lines: docs/tools.md
+47-47Lines changed: 47 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,53 @@ async def main():
37
37
print(result.final_output)
38
38
```
39
39
40
+
### Hosted container shell + skills
41
+
42
+
`ShellTool` also supports OpenAI-hosted container execution. Use this mode when you want the model to run shell commands in a managed container instead of your local runtime.
43
+
44
+
```python
45
+
from agents import Agent, Runner, ShellTool, ShellToolSkillReference
instructions="Use the mounted skill when helpful.",
57
+
tools=[
58
+
ShellTool(
59
+
environment={
60
+
"type": "container_auto",
61
+
"network_policy": {"type": "disabled"},
62
+
"skills": [csv_skill],
63
+
}
64
+
)
65
+
],
66
+
)
67
+
68
+
result =await Runner.run(
69
+
agent,
70
+
"Use the configured skill to analyze CSV files in /mnt/data and summarize totals by region.",
71
+
)
72
+
print(result.final_output)
73
+
```
74
+
75
+
To reuse an existing container in later runs, set `environment={"type": "container_reference", "container_id": "cntr_..."}`.
76
+
77
+
What to know:
78
+
79
+
- Hosted shell is available through the Responses API shell tool.
80
+
-`container_auto` provisions a container for the request; `container_reference` reuses an existing one.
81
+
-`environment.skills` accepts skill references and inline skill bundles.
82
+
- With hosted environments, do not set `executor`, `needs_approval`, or `on_approval` on `ShellTool`.
83
+
-`network_policy` supports `disabled` and `allowlist` modes.
84
+
- See `examples/tools/container_shell_skill_reference.py` and `examples/tools/container_shell_inline_skill.py` for complete examples.
85
+
- OpenAI platform guides: [Shell](https://platform.openai.com/docs/guides/tools-shell) and [Skills](https://platform.openai.com/docs/guides/tools-skills).
86
+
40
87
## Local runtime tools
41
88
42
89
Local runtime tools execute in your environment and require you to supply implementations:
@@ -86,53 +133,6 @@ agent = Agent(
86
133
)
87
134
```
88
135
89
-
### Hosted container shell + skills
90
-
91
-
`ShellTool` also supports OpenAI-hosted container execution. Use this mode when you want the model to run shell commands in a managed container instead of your local runtime.
92
-
93
-
```python
94
-
from agents import Agent, Runner, ShellTool, ShellToolSkillReference
0 commit comments