@aigne/example-workflow-orchestrator 1.1.0-beta.15 → 1.1.0-beta.16
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 +21 -3
- package/index.ts +3 -0
- package/package.json +3 -3
- package/usage.ts +3 -0
package/README.md
CHANGED
|
@@ -36,6 +36,7 @@ class proofreader processing
|
|
|
36
36
|
class fact_checker processing
|
|
37
37
|
class style_enforcer processing
|
|
38
38
|
```
|
|
39
|
+
|
|
39
40
|
## Prerequisites
|
|
40
41
|
|
|
41
42
|
- [Node.js](https://nodejs.org) and npm installed on your machine
|
|
@@ -74,6 +75,14 @@ Setup your OpenAI API key in the `.env.local` file:
|
|
|
74
75
|
OPENAI_API_KEY="" # setup your OpenAI API key here
|
|
75
76
|
```
|
|
76
77
|
|
|
78
|
+
When running Puppeteer inside a Docker container, set the following environment variable:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
DOCKER_CONTAINER="true"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
This ensures Puppeteer configures itself correctly for a Docker environment, preventing potential compatibility issues.
|
|
85
|
+
|
|
77
86
|
### Run the Example
|
|
78
87
|
|
|
79
88
|
```bash
|
|
@@ -89,7 +98,12 @@ Here is the generated report for this example: [arcblock-deep-research.md](./gen
|
|
|
89
98
|
```typescript
|
|
90
99
|
import assert from "node:assert";
|
|
91
100
|
import { OrchestratorAgent } from "@aigne/agent-library";
|
|
92
|
-
import {
|
|
101
|
+
import {
|
|
102
|
+
AIAgent,
|
|
103
|
+
ChatModelOpenAI,
|
|
104
|
+
ExecutionEngine,
|
|
105
|
+
MCPAgent,
|
|
106
|
+
} from "@aigne/core-next";
|
|
93
107
|
|
|
94
108
|
const { OPENAI_API_KEY } = process.env;
|
|
95
109
|
assert(OPENAI_API_KEY, "Please set the OPENAI_API_KEY environment variable");
|
|
@@ -101,6 +115,9 @@ const model = new ChatModelOpenAI({
|
|
|
101
115
|
const puppeteer = await MCPAgent.from({
|
|
102
116
|
command: "npx",
|
|
103
117
|
args: ["-y", "@modelcontextprotocol/server-puppeteer"],
|
|
118
|
+
env: {
|
|
119
|
+
...(process.env as Record<string, string>),
|
|
120
|
+
},
|
|
104
121
|
});
|
|
105
122
|
|
|
106
123
|
const finder = AIAgent.from({
|
|
@@ -141,7 +158,8 @@ const writer = AIAgent.from({
|
|
|
141
158
|
|
|
142
159
|
const proofreader = AIAgent.from({
|
|
143
160
|
name: "proofreader",
|
|
144
|
-
description:
|
|
161
|
+
description:
|
|
162
|
+
"Review the short story for grammar, spelling, and punctuation errors",
|
|
145
163
|
instructions: `Review the short story for grammar, spelling, and punctuation errors.
|
|
146
164
|
Identify any awkward phrasing or structural issues that could improve clarity.
|
|
147
165
|
Provide detailed feedback on corrections.`,
|
|
@@ -178,7 +196,7 @@ Conduct an in-depth research on ArcBlock using only the official website\
|
|
|
178
196
|
(avoid search engines or third-party sources) and compile a detailed report saved as arcblock.md. \
|
|
179
197
|
The report should include comprehensive insights into the company's products \
|
|
180
198
|
(with detailed research findings and links), technical architecture, and future plans.`,
|
|
181
|
-
agent
|
|
199
|
+
agent
|
|
182
200
|
);
|
|
183
201
|
console.log(result);
|
|
184
202
|
// Output:
|
package/index.ts
CHANGED
|
@@ -20,6 +20,9 @@ const model = new ChatModelOpenAI({
|
|
|
20
20
|
const puppeteer = await MCPAgent.from({
|
|
21
21
|
command: "npx",
|
|
22
22
|
args: ["-y", "@modelcontextprotocol/server-puppeteer"],
|
|
23
|
+
env: {
|
|
24
|
+
...(process.env as Record<string, string>),
|
|
25
|
+
},
|
|
23
26
|
});
|
|
24
27
|
|
|
25
28
|
const finder = AIAgent.from({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/example-workflow-orchestrator",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.16",
|
|
4
4
|
"description": "A demonstration of using AIGNE Framework to build a orchestrator workflow",
|
|
5
5
|
"author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
|
|
6
6
|
"homepage": "https://github.com/AIGNE-io/aigne-framework/tree/main/examples/workflow-orchestrator",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"zod": "^3.24.2",
|
|
20
|
-
"@aigne/agent-library": "^1.1.0-beta.
|
|
21
|
-
"@aigne/core-next": "^1.1.0-beta.
|
|
20
|
+
"@aigne/agent-library": "^1.1.0-beta.16",
|
|
21
|
+
"@aigne/core-next": "^1.1.0-beta.16"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"start": "npx -y bun run index.ts"
|
package/usage.ts
CHANGED
|
@@ -12,6 +12,9 @@ const model = new ChatModelOpenAI({
|
|
|
12
12
|
const puppeteer = await MCPAgent.from({
|
|
13
13
|
command: "npx",
|
|
14
14
|
args: ["-y", "@modelcontextprotocol/server-puppeteer"],
|
|
15
|
+
env: {
|
|
16
|
+
...(process.env as Record<string, string>),
|
|
17
|
+
},
|
|
15
18
|
});
|
|
16
19
|
|
|
17
20
|
const finder = AIAgent.from({
|