@openai/agents 0.13.0 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -26
- package/dist/metadata.js +3 -3
- package/dist/metadata.mjs +3 -3
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -12,13 +12,13 @@ The OpenAI Agents SDK is a lightweight yet powerful framework for building multi
|
|
|
12
12
|
|
|
13
13
|
1. [**Agents**](https://openai.github.io/openai-agents-js/guides/agents): LLMs configured with instructions, tools, guardrails, and handoffs
|
|
14
14
|
1. [**Sandbox Agents**](https://openai.github.io/openai-agents-js/guides/sandbox-agents): Agents paired with a filesystem workspace and sandbox environment for longer-running work
|
|
15
|
+
1. [**Realtime Agents**](https://openai.github.io/openai-agents-js/guides/voice-agents/quickstart/): Low-latency voice agents with tools, guardrails, handoffs, and conversation history
|
|
15
16
|
1. **[Agents as tools](https://openai.github.io/openai-agents-js/guides/tools/#4-agents-as-tools) / [Handoffs](https://openai.github.io/openai-agents-js/guides/handoffs/)**: Delegating to other agents for specific tasks
|
|
16
17
|
1. [**Tools**](https://openai.github.io/openai-agents-js/guides/tools/): Various Tools let agents take actions (functions, MCP, hosted tools)
|
|
17
18
|
1. [**Guardrails**](https://openai.github.io/openai-agents-js/guides/guardrails/): Configurable safety checks for input and output validation
|
|
18
19
|
1. [**Human in the loop**](https://openai.github.io/openai-agents-js/guides/human-in-the-loop/): Built-in mechanisms for involving humans across agent runs
|
|
19
20
|
1. [**Sessions**](https://openai.github.io/openai-agents-js/guides/sessions/): Automatic conversation history management across agent runs
|
|
20
21
|
1. [**Tracing**](https://openai.github.io/openai-agents-js/guides/tracing/): Built-in tracking of agent runs, allowing you to view, debug and optimize your workflows
|
|
21
|
-
1. [**Realtime Agents**](https://openai.github.io/openai-agents-js/guides/voice-agents/quickstart/): Build powerful voice agents with full features
|
|
22
22
|
|
|
23
23
|
Explore the [`examples/`](https://github.com/openai/openai-agents-js/tree/main/examples) directory to see the SDK in action.
|
|
24
24
|
|
|
@@ -42,9 +42,9 @@ Explore the [`examples/`](https://github.com/openai/openai-agents-js/tree/main/e
|
|
|
42
42
|
npm install @openai/agents zod
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
###
|
|
45
|
+
### Build a sandbox agent
|
|
46
46
|
|
|
47
|
-
[Sandbox
|
|
47
|
+
Use a [Sandbox Agent](https://openai.github.io/openai-agents-js/guides/sandbox-agents) when the agent should work in a filesystem, run commands, or carry workspace state across longer tasks. Sandbox Agents are in beta.
|
|
48
48
|
|
|
49
49
|
```js
|
|
50
50
|
import { run } from '@openai/agents';
|
|
@@ -53,55 +53,58 @@ import { UnixLocalSandboxClient } from '@openai/agents/sandbox/local';
|
|
|
53
53
|
|
|
54
54
|
const agent = new SandboxAgent({
|
|
55
55
|
name: 'Workspace Assistant',
|
|
56
|
-
|
|
56
|
+
model: 'gpt-5.5',
|
|
57
|
+
instructions: 'Inspect the repo before changing files.',
|
|
57
58
|
defaultManifest: {
|
|
58
|
-
entries: {
|
|
59
|
-
repo: gitRepo({
|
|
60
|
-
repo: 'openai/openai-agents-js',
|
|
61
|
-
ref: 'main',
|
|
62
|
-
}),
|
|
63
|
-
},
|
|
59
|
+
entries: { repo: gitRepo({ repo: 'openai/openai-agents-js' }) },
|
|
64
60
|
},
|
|
65
61
|
});
|
|
66
62
|
|
|
67
63
|
const result = await run(
|
|
68
64
|
agent,
|
|
69
|
-
'Inspect repo
|
|
70
|
-
{
|
|
71
|
-
sandbox: {
|
|
72
|
-
client: new UnixLocalSandboxClient(),
|
|
73
|
-
},
|
|
74
|
-
},
|
|
65
|
+
'Inspect the repo README and summarize what this project does.',
|
|
66
|
+
{ sandbox: { client: new UnixLocalSandboxClient() } },
|
|
75
67
|
);
|
|
76
68
|
|
|
77
69
|
console.log(result.finalOutput);
|
|
78
|
-
// This project provides a JavaScript/TypeScript SDK for building agent workflows.
|
|
79
70
|
```
|
|
80
71
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
### Run an agent without a sandbox
|
|
72
|
+
### Build a text agent
|
|
84
73
|
|
|
85
|
-
|
|
74
|
+
Use a regular [Agent](https://openai.github.io/openai-agents-js/guides/agents) for text-based workflows that do not need a sandbox workspace or Realtime session.
|
|
86
75
|
|
|
87
76
|
```js
|
|
88
77
|
import { Agent, run } from '@openai/agents';
|
|
89
78
|
|
|
90
79
|
const agent = new Agent({
|
|
91
80
|
name: 'Assistant',
|
|
92
|
-
instructions: 'You are a helpful assistant',
|
|
81
|
+
instructions: 'You are a helpful assistant.',
|
|
93
82
|
});
|
|
94
|
-
|
|
95
83
|
const result = await run(
|
|
96
84
|
agent,
|
|
97
85
|
'Write a haiku about recursion in programming.',
|
|
98
86
|
);
|
|
99
87
|
console.log(result.finalOutput);
|
|
100
|
-
// Code within the code,
|
|
101
|
-
// Functions calling themselves,
|
|
102
|
-
// Infinite loop's dance.
|
|
103
88
|
```
|
|
104
89
|
|
|
90
|
+
### Build a realtime voice agent
|
|
91
|
+
|
|
92
|
+
Use a [Realtime Agent](https://openai.github.io/openai-agents-js/guides/voice-agents/quickstart/) for low-latency, spoken interactions in the browser.
|
|
93
|
+
|
|
94
|
+
```js
|
|
95
|
+
import { RealtimeAgent, RealtimeSession } from '@openai/agents/realtime';
|
|
96
|
+
|
|
97
|
+
const agent = new RealtimeAgent({
|
|
98
|
+
name: 'Assistant',
|
|
99
|
+
instructions: 'You are a helpful assistant.',
|
|
100
|
+
});
|
|
101
|
+
// Automatically connects your microphone and audio output in the browser via WebRTC.
|
|
102
|
+
const session = new RealtimeSession(agent);
|
|
103
|
+
await session.connect({ apiKey: '<client-api-key>' });
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Set `OPENAI_API_KEY` in your server environment for sandbox and text agents. For browser-based voice agents, use your server to create a short-lived ephemeral client token and pass it to `session.connect(...)`.
|
|
107
|
+
|
|
105
108
|
Explore the [`examples/`](https://github.com/openai/openai-agents-js/tree/main/examples) directory to see the SDK in action.
|
|
106
109
|
|
|
107
110
|
## Acknowledgements
|
package/dist/metadata.js
CHANGED
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.METADATA = void 0;
|
|
5
5
|
exports.METADATA = {
|
|
6
6
|
"name": "@openai/agents",
|
|
7
|
-
"version": "0.13.
|
|
7
|
+
"version": "0.13.2",
|
|
8
8
|
"versions": {
|
|
9
|
-
"@openai/agents": "0.13.
|
|
9
|
+
"@openai/agents": "0.13.2",
|
|
10
10
|
"@openai/agents-core": "workspace:*",
|
|
11
11
|
"@openai/agents-openai": "workspace:*",
|
|
12
12
|
"@openai/agents-realtime": "workspace:*",
|
|
13
|
-
"openai": "^6.
|
|
13
|
+
"openai": "^6.46.0"
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
exports.default = exports.METADATA;
|
package/dist/metadata.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// This file is automatically generated
|
|
2
2
|
export const METADATA = {
|
|
3
3
|
"name": "@openai/agents",
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.2",
|
|
5
5
|
"versions": {
|
|
6
|
-
"@openai/agents": "0.13.
|
|
6
|
+
"@openai/agents": "0.13.2",
|
|
7
7
|
"@openai/agents-core": "workspace:*",
|
|
8
8
|
"@openai/agents-openai": "workspace:*",
|
|
9
9
|
"@openai/agents-realtime": "workspace:*",
|
|
10
|
-
"openai": "^6.
|
|
10
|
+
"openai": "^6.46.0"
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
export default METADATA;
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "https://github.com/openai/openai-agents-js"
|
|
6
6
|
},
|
|
7
7
|
"homepage": "https://openai.github.io/openai-agents-js/",
|
|
8
|
-
"version": "0.13.
|
|
8
|
+
"version": "0.13.2",
|
|
9
9
|
"description": "The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows.",
|
|
10
10
|
"author": "OpenAI <support@openai.com>",
|
|
11
11
|
"main": "dist/index.js",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"debug": "^4.4.0",
|
|
42
|
-
"openai": "^6.
|
|
43
|
-
"@openai/agents-core": "0.13.
|
|
44
|
-
"@openai/agents-openai": "0.13.
|
|
45
|
-
"@openai/agents-realtime": "0.13.
|
|
42
|
+
"openai": "^6.46.0",
|
|
43
|
+
"@openai/agents-core": "0.13.2",
|
|
44
|
+
"@openai/agents-openai": "0.13.2",
|
|
45
|
+
"@openai/agents-realtime": "0.13.2"
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
48
48
|
"openai",
|