@aigne/example-workflow-reflection 1.3.0 → 1.4.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/index.ts +1 -1
  2. package/package.json +4 -3
  3. package/usages.ts +11 -2
package/index.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env npx -y bun
2
2
 
3
3
  import assert from "node:assert";
4
+ import { runChatLoopInTerminal } from "@aigne/cli/utils/run-chat-loop.js";
4
5
  import { AIAgent, ExecutionEngine, UserAgent, UserInputTopic, UserOutputTopic } from "@aigne/core";
5
6
  import { OpenAIChatModel } from "@aigne/core/models/openai-chat-model.js";
6
- import { runChatLoopInTerminal } from "@aigne/core/utils/run-chat-loop.js";
7
7
  import { z } from "zod";
8
8
 
9
9
  const { OPENAI_API_KEY } = process.env;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/example-workflow-reflection",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "A demonstration of using AIGNE Framework to build a reflection 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-reflection",
@@ -16,9 +16,10 @@
16
16
  "README.md"
17
17
  ],
18
18
  "dependencies": {
19
- "openai": "^4.91.1",
19
+ "openai": "^4.93.0",
20
20
  "zod": "^3.24.2",
21
- "@aigne/core": "^1.6.0"
21
+ "@aigne/cli": "^1.2.0",
22
+ "@aigne/core": "^1.7.0"
22
23
  },
23
24
  "scripts": {
24
25
  "start": "npx -y bun run index.ts",
package/usages.ts CHANGED
@@ -1,5 +1,11 @@
1
1
  import assert from "node:assert";
2
- import { AIAgent, ExecutionEngine, UserInputTopic, UserOutputTopic } from "@aigne/core";
2
+ import {
3
+ AIAgent,
4
+ ExecutionEngine,
5
+ UserInputTopic,
6
+ UserOutputTopic,
7
+ createPublishMessage,
8
+ } from "@aigne/core";
3
9
  import { OpenAIChatModel } from "@aigne/core/models/openai-chat-model.js";
4
10
  import { z } from "zod";
5
11
 
@@ -69,7 +75,10 @@ Please review the code. If previous feedback was provided, see if it was address
69
75
  });
70
76
 
71
77
  const engine = new ExecutionEngine({ model, agents: [coder, reviewer] });
72
- engine.publish(UserInputTopic, "Write a function to find the sum of all even numbers in a list.");
78
+ engine.publish(
79
+ UserInputTopic,
80
+ createPublishMessage("Write a function to find the sum of all even numbers in a list."),
81
+ );
73
82
 
74
83
  const { message } = await engine.subscribe(UserOutputTopic);
75
84
  console.log(message);