@aigne/example-workflow-group-chat 1.9.1 → 1.10.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 +44 -3
- package/index.ts +1 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Workflow Group Chat Demo
|
|
2
2
|
|
|
3
|
-
This is a demonstration of using [AIGNE Framework](https://github.com/AIGNE-io/aigne-framework) to build a group chat workflow.
|
|
3
|
+
This is a demonstration of using [AIGNE Framework](https://github.com/AIGNE-io/aigne-framework) to build a group chat workflow. The example now supports both one-shot and interactive chat modes, along with customizable model settings and pipeline input/output.
|
|
4
4
|
|
|
5
5
|
```mermaid
|
|
6
6
|
flowchart LR
|
|
@@ -43,7 +43,14 @@ class illustrator processing
|
|
|
43
43
|
```bash
|
|
44
44
|
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY # Set your OpenAI API key
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
# Run in one-shot mode (default)
|
|
47
|
+
npx -y @aigne/example-workflow-group-chat
|
|
48
|
+
|
|
49
|
+
# Run in interactive chat mode
|
|
50
|
+
npx -y @aigne/example-workflow-group-chat --chat
|
|
51
|
+
|
|
52
|
+
# Use pipeline input
|
|
53
|
+
echo "Write a short story about space exploration" | npx -y @aigne/example-workflow-group-chat
|
|
47
54
|
```
|
|
48
55
|
|
|
49
56
|
## Installation
|
|
@@ -73,7 +80,41 @@ OPENAI_API_KEY="" # Set your OpenAI API key here
|
|
|
73
80
|
### Run the Example
|
|
74
81
|
|
|
75
82
|
```bash
|
|
76
|
-
pnpm start
|
|
83
|
+
pnpm start # Run in one-shot mode (default)
|
|
84
|
+
|
|
85
|
+
# Run in interactive chat mode
|
|
86
|
+
pnpm start -- --chat
|
|
87
|
+
|
|
88
|
+
# Use pipeline input
|
|
89
|
+
echo "Write a short story about space exploration" | pnpm start
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Run Options
|
|
93
|
+
|
|
94
|
+
The example supports the following command-line parameters:
|
|
95
|
+
|
|
96
|
+
| Parameter | Description | Default |
|
|
97
|
+
|-----------|-------------|---------|
|
|
98
|
+
| `--chat` | Run in interactive chat mode | Disabled (one-shot mode) |
|
|
99
|
+
| `--model <provider[:model]>` | AI model to use in format 'provider[:model]' where model is optional. Examples: 'openai' or 'openai:gpt-4o-mini' | openai |
|
|
100
|
+
| `--temperature <value>` | Temperature for model generation | Provider default |
|
|
101
|
+
| `--top-p <value>` | Top-p sampling value | Provider default |
|
|
102
|
+
| `--presence-penalty <value>` | Presence penalty value | Provider default |
|
|
103
|
+
| `--frequency-penalty <value>` | Frequency penalty value | Provider default |
|
|
104
|
+
| `--log-level <level>` | Set logging level (ERROR, WARN, INFO, DEBUG, TRACE) | INFO |
|
|
105
|
+
| `--input`, `-i <input>` | Specify input directly | None |
|
|
106
|
+
|
|
107
|
+
#### Examples
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Run in chat mode (interactive)
|
|
111
|
+
pnpm start -- --chat
|
|
112
|
+
|
|
113
|
+
# Set logging level
|
|
114
|
+
pnpm start -- --log-level DEBUG
|
|
115
|
+
|
|
116
|
+
# Use pipeline input
|
|
117
|
+
echo "Write a short story about space exploration" | pnpm start
|
|
77
118
|
```
|
|
78
119
|
|
|
79
120
|
## License
|
package/index.ts
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
createMessage,
|
|
13
13
|
getMessage,
|
|
14
14
|
} from "@aigne/core";
|
|
15
|
-
import { OpenAIChatModel } from "@aigne/
|
|
15
|
+
import { OpenAIChatModel } from "@aigne/openai";
|
|
16
16
|
import inquirer from "inquirer";
|
|
17
17
|
import { z } from "zod";
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/example-workflow-group-chat",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "A demonstration of using AIGNE Framework to build a group chat 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-group-chat",
|
|
@@ -16,13 +16,14 @@
|
|
|
16
16
|
"README.md"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"openai": "^4.97.0",
|
|
20
19
|
"zod": "^3.24.4",
|
|
21
|
-
"@aigne/
|
|
22
|
-
"@aigne/
|
|
20
|
+
"@aigne/cli": "^1.10.0",
|
|
21
|
+
"@aigne/openai": "^0.1.0",
|
|
22
|
+
"@aigne/core": "^1.16.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@
|
|
25
|
+
"@types/bun": "^1.2.9",
|
|
26
|
+
"@aigne/test-utils": "^0.3.0"
|
|
26
27
|
},
|
|
27
28
|
"scripts": {
|
|
28
29
|
"start": "bun run index.ts",
|