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