@aigne/example-workflow-orchestrator 1.7.2 → 1.8.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/LICENSE +93 -0
- package/README.md +6 -6
- package/index.ts +6 -6
- package/package.json +8 -5
- package/usage.ts +6 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Elastic License 2.0
|
|
2
|
+
|
|
3
|
+
URL: https://www.elastic.co/licensing/elastic-license
|
|
4
|
+
|
|
5
|
+
## Acceptance
|
|
6
|
+
|
|
7
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
8
|
+
|
|
9
|
+
## Copyright License
|
|
10
|
+
|
|
11
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide,
|
|
12
|
+
non-sublicensable, non-transferable license to use, copy, distribute, make
|
|
13
|
+
available, and prepare derivative works of the software, in each case subject to
|
|
14
|
+
the limitations and conditions below.
|
|
15
|
+
|
|
16
|
+
## Limitations
|
|
17
|
+
|
|
18
|
+
You may not provide the software to third parties as a hosted or managed
|
|
19
|
+
service, where the service provides users with access to any substantial set of
|
|
20
|
+
the features or functionality of the software.
|
|
21
|
+
|
|
22
|
+
You may not move, change, disable, or circumvent the license key functionality
|
|
23
|
+
in the software, and you may not remove or obscure any functionality in the
|
|
24
|
+
software that is protected by the license key.
|
|
25
|
+
|
|
26
|
+
You may not alter, remove, or obscure any licensing, copyright, or other notices
|
|
27
|
+
of the licensor in the software. Any use of the licensor’s trademarks is subject
|
|
28
|
+
to applicable law.
|
|
29
|
+
|
|
30
|
+
## Patents
|
|
31
|
+
|
|
32
|
+
The licensor grants you a license, under any patent claims the licensor can
|
|
33
|
+
license, or becomes able to license, to make, have made, use, sell, offer for
|
|
34
|
+
sale, import and have imported the software, in each case subject to the
|
|
35
|
+
limitations and conditions in this license. This license does not cover any
|
|
36
|
+
patent claims that you cause to be infringed by modifications or additions to
|
|
37
|
+
the software. If you or your company make any written claim that the software
|
|
38
|
+
infringes or contributes to infringement of any patent, your patent license for
|
|
39
|
+
the software granted under these terms ends immediately. If your company makes
|
|
40
|
+
such a claim, your patent license ends immediately for work on behalf of your
|
|
41
|
+
company.
|
|
42
|
+
|
|
43
|
+
## Notices
|
|
44
|
+
|
|
45
|
+
You must ensure that anyone who gets a copy of any part of the software from you
|
|
46
|
+
also gets a copy of these terms.
|
|
47
|
+
|
|
48
|
+
If you modify the software, you must include in any modified copies of the
|
|
49
|
+
software prominent notices stating that you have modified the software.
|
|
50
|
+
|
|
51
|
+
## No Other Rights
|
|
52
|
+
|
|
53
|
+
These terms do not imply any licenses other than those expressly granted in
|
|
54
|
+
these terms.
|
|
55
|
+
|
|
56
|
+
## Termination
|
|
57
|
+
|
|
58
|
+
If you use the software in violation of these terms, such use is not licensed,
|
|
59
|
+
and your licenses will automatically terminate. If the licensor provides you
|
|
60
|
+
with a notice of your violation, and you cease all violation of this license no
|
|
61
|
+
later than 30 days after you receive that notice, your licenses will be
|
|
62
|
+
reinstated retroactively. However, if you violate these terms after such
|
|
63
|
+
reinstatement, any additional violation of these terms will cause your licenses
|
|
64
|
+
to terminate automatically and permanently.
|
|
65
|
+
|
|
66
|
+
## No Liability
|
|
67
|
+
|
|
68
|
+
*As far as the law allows, the software comes as is, without any warranty or
|
|
69
|
+
condition, and the licensor will not be liable to you for any damages arising
|
|
70
|
+
out of these terms or the use or nature of the software, under any kind of
|
|
71
|
+
legal claim.*
|
|
72
|
+
|
|
73
|
+
## Definitions
|
|
74
|
+
|
|
75
|
+
The **licensor** is the entity offering these terms, and the **software** is the
|
|
76
|
+
software the licensor makes available under these terms, including any portion
|
|
77
|
+
of it.
|
|
78
|
+
|
|
79
|
+
**you** refers to the individual or entity agreeing to these terms.
|
|
80
|
+
|
|
81
|
+
**your company** is any legal entity, sole proprietorship, or other kind of
|
|
82
|
+
organization that you work for, plus all organizations that have control over,
|
|
83
|
+
are under the control of, or are under common control with that
|
|
84
|
+
organization. **control** means ownership of substantially all the assets of an
|
|
85
|
+
entity, or the power to direct its management and policies by vote, contract, or
|
|
86
|
+
otherwise. Control can be direct or indirect.
|
|
87
|
+
|
|
88
|
+
**your licenses** are all the licenses granted to you for the software under
|
|
89
|
+
these terms.
|
|
90
|
+
|
|
91
|
+
**use** means anything you do with the software requiring one of your licenses.
|
|
92
|
+
|
|
93
|
+
**trademark** means trademarks, service marks, and similar rights.
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
150
|
+
skills: [filesystem],
|
|
151
151
|
});
|
|
152
152
|
|
|
153
153
|
const agent = OrchestratorAgent.from({
|
|
154
|
-
|
|
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
|
|
159
|
+
const aigne = new AIGNE({ model });
|
|
160
160
|
|
|
161
|
-
const result = await
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
44
|
+
skills: [filesystem],
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
const agent = OrchestratorAgent.from({
|
|
48
|
-
|
|
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
|
|
53
|
+
const aigne = new AIGNE({ model });
|
|
54
54
|
|
|
55
|
-
const userAgent =
|
|
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,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/example-workflow-orchestrator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.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",
|
|
7
|
-
"license": "
|
|
7
|
+
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/AIGNE-io/aigne-framework"
|
|
@@ -18,9 +18,12 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"openai": "^4.94.0",
|
|
20
20
|
"zod": "^3.24.2",
|
|
21
|
-
"@aigne/agent-library": "^1.
|
|
22
|
-
"@aigne/
|
|
23
|
-
"@aigne/
|
|
21
|
+
"@aigne/agent-library": "^1.7.0",
|
|
22
|
+
"@aigne/cli": "^1.8.0",
|
|
23
|
+
"@aigne/core": "^1.12.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,
|
|
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
|
-
|
|
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
|
-
|
|
50
|
+
skills: [filesystem],
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
const agent = OrchestratorAgent.from({
|
|
54
|
-
|
|
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
|
|
59
|
+
const aigne = new AIGNE({ model });
|
|
60
60
|
|
|
61
|
-
const result = await
|
|
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\
|