@aigne/example-workflow-group-chat 1.11.6 → 1.11.9
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/index.ts +6 -4
- package/package.json +6 -6
package/index.ts
CHANGED
|
@@ -10,8 +10,6 @@ import {
|
|
|
10
10
|
FunctionAgent,
|
|
11
11
|
PromptTemplate,
|
|
12
12
|
UserAgent,
|
|
13
|
-
createMessage,
|
|
14
|
-
getMessage,
|
|
15
13
|
} from "@aigne/core";
|
|
16
14
|
import { OpenAIChatModel } from "@aigne/openai";
|
|
17
15
|
import inquirer from "inquirer";
|
|
@@ -37,6 +35,7 @@ const writer = AIAgent.from({
|
|
|
37
35
|
publishTopic: DEFAULT_TOPIC,
|
|
38
36
|
memory: new DefaultMemory({ subscribeTopic: DEFAULT_TOPIC }),
|
|
39
37
|
instructions: "You are a Writer. You produce good work.",
|
|
38
|
+
inputKey: "message",
|
|
40
39
|
});
|
|
41
40
|
|
|
42
41
|
const editor = AIAgent.from({
|
|
@@ -48,6 +47,7 @@ const editor = AIAgent.from({
|
|
|
48
47
|
You are an Editor. Plan and guide the task given by the user.
|
|
49
48
|
Provide critical feedbacks to the draft and illustration produced by Writer and Illustrator.
|
|
50
49
|
Approve if the task is completed and the draft and illustration meets user's requirements.`,
|
|
50
|
+
inputKey: "message",
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
const generateImage = FunctionAgent.from({
|
|
@@ -83,6 +83,7 @@ Make sure the images have consistent characters and style.`,
|
|
|
83
83
|
)
|
|
84
84
|
.describe("The images created by the illustrator"),
|
|
85
85
|
}),
|
|
86
|
+
inputKey: "message",
|
|
86
87
|
});
|
|
87
88
|
|
|
88
89
|
let isFirstQuestion = true;
|
|
@@ -105,7 +106,7 @@ const user = UserAgent.from({
|
|
|
105
106
|
},
|
|
106
107
|
]);
|
|
107
108
|
isFirstQuestion = false;
|
|
108
|
-
return
|
|
109
|
+
return { message: question };
|
|
109
110
|
},
|
|
110
111
|
});
|
|
111
112
|
|
|
@@ -137,6 +138,7 @@ const manager = AIAgent.from({
|
|
|
137
138
|
.union(assertZodUnionArray(roles.map((i) => z.literal(i.topic))))
|
|
138
139
|
.describe("The next role to play"),
|
|
139
140
|
}),
|
|
141
|
+
inputKey: "message",
|
|
140
142
|
});
|
|
141
143
|
|
|
142
144
|
aigne.addAgent(user, writer, editor, illustrator, manager);
|
|
@@ -145,7 +147,7 @@ aigne.subscribe(DEFAULT_TOPIC, (message) => {
|
|
|
145
147
|
console.log(
|
|
146
148
|
"------------- Received message -------------\n",
|
|
147
149
|
`${message.source}:`,
|
|
148
|
-
|
|
150
|
+
message.message.message || message.message,
|
|
149
151
|
"\n--------------------------------------------",
|
|
150
152
|
);
|
|
151
153
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/example-workflow-group-chat",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.9",
|
|
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",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"zod": "^3.24.4",
|
|
20
|
-
"@aigne/agent-library": "^1.
|
|
21
|
-
"@aigne/
|
|
22
|
-
"@aigne/
|
|
23
|
-
"@aigne/openai": "^0.2
|
|
20
|
+
"@aigne/agent-library": "^1.13.2",
|
|
21
|
+
"@aigne/core": "^1.20.1",
|
|
22
|
+
"@aigne/cli": "^1.11.9",
|
|
23
|
+
"@aigne/openai": "^0.3.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/bun": "^1.2.9",
|
|
27
|
-
"@aigne/test-utils": "^0.
|
|
27
|
+
"@aigne/test-utils": "^0.4.2"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"start": "bun run index.ts",
|