@aigne/example-workflow-concurrency 1.4.0 → 1.6.1

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 +8 -6
  2. package/index.ts +3 -9
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -27,15 +27,17 @@ class aggregator processing
27
27
  ## Prerequisites
28
28
 
29
29
  - [Node.js](https://nodejs.org) and npm installed on your machine
30
- - [OpenAI API key](https://platform.openai.com/api-keys) used to interact with OpenAI API
31
- - [Pnpm](https://pnpm.io) [Optional] if you want to run the example from source code
30
+ - An [OpenAI API key](https://platform.openai.com/api-keys) for interacting with OpenAI's services
31
+ - Optional dependencies (if running the example from source code):
32
+ - [Bun](https://bun.sh) for running unit tests & examples
33
+ - [Pnpm](https://pnpm.io) for package management
32
34
 
33
- ## Try without Installation
35
+ ## Quick Start (No Installation Required)
34
36
 
35
37
  ```bash
36
- export OPENAI_API_KEY=YOUR_OPENAI_API_KEY # setup your OpenAI API key
38
+ export OPENAI_API_KEY=YOUR_OPENAI_API_KEY # Set your OpenAI API key
37
39
 
38
- npx -y @aigne/example-workflow-concurrency # run the example
40
+ npx -y @aigne/example-workflow-concurrency # Run the example
39
41
  ```
40
42
 
41
43
  ## Installation
@@ -59,7 +61,7 @@ pnpm install
59
61
  Setup your OpenAI API key in the `.env.local` file:
60
62
 
61
63
  ```bash
62
- OPENAI_API_KEY="" # setup your OpenAI API key here
64
+ OPENAI_API_KEY="" # Set your OpenAI API key here
63
65
  ```
64
66
 
65
67
  ### Run the Example
package/index.ts CHANGED
@@ -1,16 +1,10 @@
1
- #!/usr/bin/env npx -y bun
1
+ #!/usr/bin/env bunwrapper
2
2
 
3
- import assert from "node:assert";
4
3
  import { runChatLoopInTerminal } from "@aigne/cli/utils/run-chat-loop.js";
5
4
  import { AIAgent, ExecutionEngine, parallel } from "@aigne/core";
6
- import { OpenAIChatModel } from "@aigne/core/models/openai-chat-model.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 featureExtractor = AIAgent.from({
16
10
  instructions: `\
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/example-workflow-concurrency",
3
- "version": "1.4.0",
3
+ "version": "1.6.1",
4
4
  "description": "A demonstration of using AIGNE Framework to build a concurrency 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-concurrency",
@@ -16,13 +16,13 @@
16
16
  "README.md"
17
17
  ],
18
18
  "dependencies": {
19
- "openai": "^4.93.0",
19
+ "openai": "^4.94.0",
20
20
  "zod": "^3.24.2",
21
- "@aigne/cli": "^1.2.0",
22
- "@aigne/core": "^1.7.0"
21
+ "@aigne/core": "^1.10.0",
22
+ "@aigne/cli": "^1.5.1"
23
23
  },
24
24
  "scripts": {
25
- "start": "npx -y bun run index.ts",
25
+ "start": "bun run index.ts",
26
26
  "lint": "tsc --noEmit"
27
27
  }
28
28
  }