@openai/agents 0.8.5 → 0.9.1
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 +44 -7
- package/dist/metadata.js +2 -2
- package/dist/metadata.mjs +2 -2
- package/dist/sandbox/index.d.ts +1 -0
- package/dist/sandbox/index.js +18 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/sandbox/index.mjs +2 -0
- package/dist/sandbox/index.mjs.map +1 -0
- package/dist/sandbox/local.d.ts +1 -0
- package/dist/sandbox/local.js +18 -0
- package/dist/sandbox/local.js.map +1 -0
- package/dist/sandbox/local.mjs +2 -0
- package/dist/sandbox/local.mjs.map +1 -0
- package/package.json +20 -4
package/README.md
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
# OpenAI Agents SDK (JavaScript/TypeScript)
|
|
2
2
|
|
|
3
|
-
[](https://badge.fury.io/js/@openai%2Fagents)
|
|
4
|
-
[](https://github.com/openai/openai-agents-js/actions/workflows/test.yml)
|
|
3
|
+
[](https://badge.fury.io/js/@openai%2Fagents) [](https://github.com/openai/openai-agents-js/actions/workflows/test.yml)
|
|
5
4
|
|
|
6
5
|
The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows in JavaScript/TypeScript. It is provider-agnostic, supporting OpenAI APIs and more.
|
|
7
6
|
|
|
8
7
|
<img src="https://cdn.openai.com/API/docs/images/orchestration.png" alt="Image of the Agents Tracing UI" style="max-height: 803px;">
|
|
9
8
|
|
|
10
|
-
> [!NOTE]
|
|
11
|
-
> Looking for the Python version? Check out [OpenAI Agents SDK Python](https://github.com/openai/openai-agents-python).
|
|
9
|
+
> [!NOTE] Looking for the Python version? Check out [OpenAI Agents SDK Python](https://github.com/openai/openai-agents-python).
|
|
12
10
|
|
|
13
11
|
## Core concepts
|
|
14
12
|
|
|
15
13
|
1. [**Agents**](https://openai.github.io/openai-agents-js/guides/agents): LLMs configured with instructions, tools, guardrails, and handoffs
|
|
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
|
|
16
15
|
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
|
|
17
16
|
1. [**Tools**](https://openai.github.io/openai-agents-js/guides/tools/): Various Tools let agents take actions (functions, MCP, hosted tools)
|
|
18
17
|
1. [**Guardrails**](https://openai.github.io/openai-agents-js/guides/guardrails/): Configurable safety checks for input and output validation
|
|
@@ -43,7 +42,47 @@ Explore the [`examples/`](https://github.com/openai/openai-agents-js/tree/main/e
|
|
|
43
42
|
npm install @openai/agents zod
|
|
44
43
|
```
|
|
45
44
|
|
|
46
|
-
### Run your first
|
|
45
|
+
### Run your first Sandbox Agent
|
|
46
|
+
|
|
47
|
+
[Sandbox Agents](https://openai.github.io/openai-agents-js/guides/sandbox-agents) are in beta. A sandbox agent can inspect files, run commands, apply patches, and carry workspace state across longer tasks.
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
import { run } from '@openai/agents';
|
|
51
|
+
import { gitRepo, Manifest, SandboxAgent } from '@openai/agents/sandbox';
|
|
52
|
+
import { UnixLocalSandboxClient } from '@openai/agents/sandbox/local';
|
|
53
|
+
|
|
54
|
+
const agent = new SandboxAgent({
|
|
55
|
+
name: 'Workspace Assistant',
|
|
56
|
+
instructions: 'Inspect the sandbox workspace before answering.',
|
|
57
|
+
defaultManifest: new Manifest({
|
|
58
|
+
entries: {
|
|
59
|
+
repo: gitRepo({
|
|
60
|
+
repo: 'openai/openai-agents-js',
|
|
61
|
+
ref: 'main',
|
|
62
|
+
}),
|
|
63
|
+
},
|
|
64
|
+
}),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const result = await run(
|
|
68
|
+
agent,
|
|
69
|
+
'Inspect repo/README.md and summarize what this project does.',
|
|
70
|
+
{
|
|
71
|
+
sandbox: {
|
|
72
|
+
client: new UnixLocalSandboxClient(),
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
console.log(result.finalOutput);
|
|
78
|
+
// This project provides a JavaScript/TypeScript SDK for building agent workflows.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
(_If running this, ensure you set the `OPENAI_API_KEY` environment variable_)
|
|
82
|
+
|
|
83
|
+
### Run an agent without a sandbox
|
|
84
|
+
|
|
85
|
+
You can still use a regular `Agent` when your workflow does not need a filesystem workspace or sandbox lifecycle.
|
|
47
86
|
|
|
48
87
|
```js
|
|
49
88
|
import { Agent, run } from '@openai/agents';
|
|
@@ -63,8 +102,6 @@ console.log(result.finalOutput);
|
|
|
63
102
|
// Infinite loop's dance.
|
|
64
103
|
```
|
|
65
104
|
|
|
66
|
-
(_If running this, ensure you set the `OPENAI_API_KEY` environment variable_)
|
|
67
|
-
|
|
68
105
|
Explore the [`examples/`](https://github.com/openai/openai-agents-js/tree/main/examples) directory to see the SDK in action.
|
|
69
106
|
|
|
70
107
|
## Acknowledgements
|
package/dist/metadata.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.METADATA = void 0;
|
|
5
5
|
exports.METADATA = {
|
|
6
6
|
"name": "@openai/agents",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.9.1",
|
|
8
8
|
"versions": {
|
|
9
|
-
"@openai/agents": "0.
|
|
9
|
+
"@openai/agents": "0.9.1",
|
|
10
10
|
"@openai/agents-core": "workspace:*",
|
|
11
11
|
"@openai/agents-openai": "workspace:*",
|
|
12
12
|
"@openai/agents-realtime": "workspace:*",
|
package/dist/metadata.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file is automatically generated
|
|
2
2
|
export const METADATA = {
|
|
3
3
|
"name": "@openai/agents",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.1",
|
|
5
5
|
"versions": {
|
|
6
|
-
"@openai/agents": "0.
|
|
6
|
+
"@openai/agents": "0.9.1",
|
|
7
7
|
"@openai/agents-core": "workspace:*",
|
|
8
8
|
"@openai/agents-openai": "workspace:*",
|
|
9
9
|
"@openai/agents-realtime": "workspace:*",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@openai/agents-core/sandbox';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("@openai/agents-core/sandbox"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sandbox/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/sandbox/index.ts"],"names":[],"mappings":"cAAc,6BAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@openai/agents-core/sandbox/local';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("@openai/agents-core/sandbox/local"), exports);
|
|
18
|
+
//# sourceMappingURL=local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../src/sandbox/local.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.mjs","sourceRoot":"","sources":["../../src/sandbox/local.ts"],"names":[],"mappings":"cAAc,mCAAmC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@openai/agents",
|
|
3
3
|
"repository": "https://github.com/openai/openai-agents-js",
|
|
4
4
|
"homepage": "https://openai.github.io/openai-agents-js/",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.9.1",
|
|
6
6
|
"description": "The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows.",
|
|
7
7
|
"author": "OpenAI <support@openai.com>",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -13,6 +13,16 @@
|
|
|
13
13
|
"require": "./dist/index.js",
|
|
14
14
|
"import": "./dist/index.mjs"
|
|
15
15
|
},
|
|
16
|
+
"./sandbox": {
|
|
17
|
+
"types": "./dist/sandbox/index.d.ts",
|
|
18
|
+
"require": "./dist/sandbox/index.js",
|
|
19
|
+
"import": "./dist/sandbox/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"./sandbox/local": {
|
|
22
|
+
"types": "./dist/sandbox/local.d.ts",
|
|
23
|
+
"require": "./dist/sandbox/local.js",
|
|
24
|
+
"import": "./dist/sandbox/local.mjs"
|
|
25
|
+
},
|
|
16
26
|
"./realtime": {
|
|
17
27
|
"types": "./dist/realtime/index.d.ts",
|
|
18
28
|
"require": "./dist/realtime/index.js",
|
|
@@ -27,9 +37,9 @@
|
|
|
27
37
|
"dependencies": {
|
|
28
38
|
"debug": "^4.4.0",
|
|
29
39
|
"openai": "^6.26.0",
|
|
30
|
-
"@openai/agents-core": "0.
|
|
31
|
-
"@openai/agents-
|
|
32
|
-
"@openai/agents-
|
|
40
|
+
"@openai/agents-core": "0.9.1",
|
|
41
|
+
"@openai/agents-realtime": "0.9.1",
|
|
42
|
+
"@openai/agents-openai": "0.9.1"
|
|
33
43
|
},
|
|
34
44
|
"keywords": [
|
|
35
45
|
"openai",
|
|
@@ -50,6 +60,12 @@
|
|
|
50
60
|
],
|
|
51
61
|
"typesVersions": {
|
|
52
62
|
"*": {
|
|
63
|
+
"sandbox": [
|
|
64
|
+
"dist/sandbox/index.d.ts"
|
|
65
|
+
],
|
|
66
|
+
"sandbox/local": [
|
|
67
|
+
"dist/sandbox/local.d.ts"
|
|
68
|
+
],
|
|
53
69
|
"realtime": [
|
|
54
70
|
"dist/realtime/index.d.ts"
|
|
55
71
|
],
|