@aigne/example-workflow-orchestrator 1.7.3 → 1.9.0

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 CHANGED
@@ -100,7 +100,7 @@ Here is the generated report for this example: [arcblock-deep-research.md](./gen
100
100
  ```typescript
101
101
  import assert from "node:assert";
102
102
  import { OrchestratorAgent } from "@aigne/agent-library/orchestrator/index.js";
103
- import { AIAgent, ExecutionEngine, MCPAgent } from "@aigne/core";
103
+ import { AIAgent, AIGNE, MCPAgent } from "@aigne/core";
104
104
  import { OpenAIChatModel } from "@aigne/core/models/openai-chat-model.js";
105
105
 
106
106
  const { OPENAI_API_KEY } = process.env;
@@ -138,7 +138,7 @@ Rules:
138
138
  - if you want a url to some page, you should get all link and it's title of current(home) page,
139
139
  then you can use the title to search the url of the page you want to visit.
140
140
  `,
141
- tools: [puppeteer, filesystem],
141
+ skills: [puppeteer, filesystem],
142
142
  });
143
143
 
144
144
  const writer = AIAgent.from({
@@ -147,18 +147,18 @@ const writer = AIAgent.from({
147
147
  instructions: `You are an agent that can write to the filesystem.
148
148
  You are tasked with taking the user's input, addressing it, and
149
149
  writing the result to disk in the appropriate location.`,
150
- tools: [filesystem],
150
+ skills: [filesystem],
151
151
  });
152
152
 
153
153
  const agent = OrchestratorAgent.from({
154
- tools: [finder, writer],
154
+ skills: [finder, writer],
155
155
  maxIterations: 3,
156
156
  tasksConcurrency: 1, // puppeteer can only run one task at a time
157
157
  });
158
158
 
159
- const engine = new ExecutionEngine({ model });
159
+ const aigne = new AIGNE({ model });
160
160
 
161
- const result = await engine.call(
161
+ const result = await aigne.invoke(
162
162
  agent,
163
163
  `\
164
164
  Conduct an in-depth research on ArcBlock using only the official website\
package/index.ts CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { OrchestratorAgent } from "@aigne/agent-library/orchestrator/index.js";
4
4
  import { runChatLoopInTerminal } from "@aigne/cli/utils/run-chat-loop.js";
5
- import { AIAgent, ExecutionEngine, MCPAgent } from "@aigne/core";
5
+ import { AIAgent, AIGNE, MCPAgent } from "@aigne/core";
6
6
  import { loadModel } from "@aigne/core/loader/index.js";
7
7
 
8
8
  const model = await loadModel(null, { parallelToolCalls: false });
@@ -32,7 +32,7 @@ Rules:
32
32
  - if you want a url to some page, you should get all link and it's title of current(home) page,
33
33
  then you can use the title to search the url of the page you want to visit.
34
34
  `,
35
- tools: [puppeteer, filesystem],
35
+ skills: [puppeteer, filesystem],
36
36
  });
37
37
 
38
38
  const writer = AIAgent.from({
@@ -41,18 +41,18 @@ const writer = AIAgent.from({
41
41
  instructions: `You are an agent that can write to the filesystem.
42
42
  You are tasked with taking the user's input, addressing it, and
43
43
  writing the result to disk in the appropriate location.`,
44
- tools: [filesystem],
44
+ skills: [filesystem],
45
45
  });
46
46
 
47
47
  const agent = OrchestratorAgent.from({
48
- tools: [finder, writer],
48
+ skills: [finder, writer],
49
49
  maxIterations: 3,
50
50
  tasksConcurrency: 1, // puppeteer can only run one task at a time
51
51
  });
52
52
 
53
- const engine = new ExecutionEngine({ model });
53
+ const aigne = new AIGNE({ model });
54
54
 
55
- const userAgent = engine.call(agent);
55
+ const userAgent = aigne.invoke(agent);
56
56
 
57
57
  await runChatLoopInTerminal(userAgent, {
58
58
  welcome: "Welcome to the Orchestrator Agent!",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/example-workflow-orchestrator",
3
- "version": "1.7.3",
3
+ "version": "1.9.0",
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",
@@ -18,9 +18,12 @@
18
18
  "dependencies": {
19
19
  "openai": "^4.94.0",
20
20
  "zod": "^3.24.2",
21
- "@aigne/agent-library": "^1.6.1",
22
- "@aigne/cli": "^1.7.0",
23
- "@aigne/core": "^1.11.0"
21
+ "@aigne/cli": "^1.8.1",
22
+ "@aigne/agent-library": "^1.7.1",
23
+ "@aigne/core": "^1.13.0"
24
+ },
25
+ "devDependencies": {
26
+ "@aigne/test-utils": "^0.1.0"
24
27
  },
25
28
  "scripts": {
26
29
  "start": "bun run index.ts",
package/usage.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import assert from "node:assert";
2
2
  import { OrchestratorAgent } from "@aigne/agent-library/orchestrator/index.js";
3
- import { AIAgent, ExecutionEngine, MCPAgent } from "@aigne/core";
3
+ import { AIAgent, AIGNE, MCPAgent } from "@aigne/core";
4
4
  import { OpenAIChatModel } from "@aigne/core/models/openai-chat-model.js";
5
5
 
6
6
  const { OPENAI_API_KEY } = process.env;
@@ -38,7 +38,7 @@ Rules:
38
38
  - if you want a url to some page, you should get all link and it's title of current(home) page,
39
39
  then you can use the title to search the url of the page you want to visit.
40
40
  `,
41
- tools: [puppeteer, filesystem],
41
+ skills: [puppeteer, filesystem],
42
42
  });
43
43
 
44
44
  const writer = AIAgent.from({
@@ -47,18 +47,18 @@ const writer = AIAgent.from({
47
47
  instructions: `You are an agent that can write to the filesystem.
48
48
  You are tasked with taking the user's input, addressing it, and
49
49
  writing the result to disk in the appropriate location.`,
50
- tools: [filesystem],
50
+ skills: [filesystem],
51
51
  });
52
52
 
53
53
  const agent = OrchestratorAgent.from({
54
- tools: [finder, writer],
54
+ skills: [finder, writer],
55
55
  maxIterations: 3,
56
56
  tasksConcurrency: 1, // puppeteer can only run one task at a time
57
57
  });
58
58
 
59
- const engine = new ExecutionEngine({ model });
59
+ const aigne = new AIGNE({ model });
60
60
 
61
- const result = await engine.call(
61
+ const result = await aigne.invoke(
62
62
  agent,
63
63
  `\
64
64
  Conduct an in-depth research on ArcBlock using only the official website\