@aigne/example-workflow-handoff 1.4.0 → 1.5.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 +1 -0
- package/index.ts +2 -8
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@ end
|
|
|
43
43
|
## Prerequisites
|
|
44
44
|
|
|
45
45
|
- [Node.js](https://nodejs.org) and npm installed on your machine
|
|
46
|
+
- [Bun](https://bun.sh) installed on your machine
|
|
46
47
|
- [OpenAI API key](https://platform.openai.com/api-keys) used to interact with OpenAI API
|
|
47
48
|
- [Pnpm](https://pnpm.io) [Optional] if you want to run the example from source code
|
|
48
49
|
|
package/index.ts
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env npx -y bun
|
|
2
2
|
|
|
3
|
-
import assert from "node:assert";
|
|
4
3
|
import { runChatLoopInTerminal } from "@aigne/cli/utils/run-chat-loop.js";
|
|
5
4
|
import { AIAgent, type Agent, ExecutionEngine, FunctionAgent } from "@aigne/core";
|
|
6
|
-
import {
|
|
5
|
+
import { loadModel } from "@aigne/core/loader/index.js";
|
|
7
6
|
import { z } from "zod";
|
|
8
7
|
|
|
9
|
-
const
|
|
10
|
-
assert(OPENAI_API_KEY, "Please set the OPENAI_API_KEY environment variable");
|
|
11
|
-
|
|
12
|
-
const model = new OpenAIChatModel({
|
|
13
|
-
apiKey: OPENAI_API_KEY,
|
|
14
|
-
});
|
|
8
|
+
const model = await loadModel();
|
|
15
9
|
|
|
16
10
|
const execute_order_tool = FunctionAgent.from({
|
|
17
11
|
name: "execute_order",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/example-workflow-handoff",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "A demonstration of using AIGNE Framework to build a handoff 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-handoff",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"README.md"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"openai": "^4.
|
|
19
|
+
"openai": "^4.94.0",
|
|
20
20
|
"zod": "^3.24.2",
|
|
21
|
-
"@aigne/cli": "^1.
|
|
22
|
-
"@aigne/core": "^1.
|
|
21
|
+
"@aigne/cli": "^1.3.0",
|
|
22
|
+
"@aigne/core": "^1.8.0"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
|
-
"start": "
|
|
25
|
+
"start": "bun run index.ts",
|
|
26
26
|
"lint": "tsc --noEmit"
|
|
27
27
|
}
|
|
28
28
|
}
|