@aigne/example-workflow-handoff 1.10.1 → 1.11.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/index.ts +5 -4
- package/package.json +6 -5
- package/usages.ts +2 -2
package/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bunwrapper
|
|
2
2
|
|
|
3
|
+
import { DefaultMemory } from "@aigne/agent-library/default-memory/index.js";
|
|
3
4
|
import { runWithAIGNE } from "@aigne/cli/utils/run-with-aigne.js";
|
|
4
5
|
import { AIAgent, type Agent, FunctionAgent } from "@aigne/core";
|
|
5
6
|
import { z } from "zod";
|
|
@@ -96,7 +97,7 @@ tell them a crazy caveat and execute their order.
|
|
|
96
97
|
`,
|
|
97
98
|
skills: [transfer_back_to_triage, execute_order_tool],
|
|
98
99
|
outputKey: "sales",
|
|
99
|
-
memory:
|
|
100
|
+
memory: new DefaultMemory(),
|
|
100
101
|
});
|
|
101
102
|
|
|
102
103
|
const issuesAndRepairs = AIAgent.from({
|
|
@@ -113,7 +114,7 @@ Follow the following routine with the user:
|
|
|
113
114
|
`,
|
|
114
115
|
skills: [transfer_back_to_triage, execute_refund_tool, look_up_item_tool],
|
|
115
116
|
outputKey: "issuesAndRepairs",
|
|
116
|
-
memory:
|
|
117
|
+
memory: new DefaultMemory(),
|
|
117
118
|
});
|
|
118
119
|
|
|
119
120
|
// Assume this is a human agent
|
|
@@ -126,7 +127,7 @@ Only transfer to another agent if user explicitly asks for it.
|
|
|
126
127
|
`,
|
|
127
128
|
skills: [transfer_back_to_triage, transfer_to_sales_agent, transfer_to_issues_and_repairs],
|
|
128
129
|
outputKey: "human",
|
|
129
|
-
memory:
|
|
130
|
+
memory: new DefaultMemory(),
|
|
130
131
|
});
|
|
131
132
|
|
|
132
133
|
const triage = AIAgent.from({
|
|
@@ -139,7 +140,7 @@ But make your questions subtle and natural.
|
|
|
139
140
|
`,
|
|
140
141
|
skills: [transfer_to_issues_and_repairs, transfer_to_sales_agent, transfer_to_human_manager],
|
|
141
142
|
outputKey: "triage",
|
|
142
|
-
memory:
|
|
143
|
+
memory: new DefaultMemory(),
|
|
143
144
|
});
|
|
144
145
|
|
|
145
146
|
await runWithAIGNE(triage, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/example-workflow-handoff",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "A demonstration of using AIGNE Framework to build a handoff 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-handoff",
|
|
@@ -17,13 +17,14 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"zod": "^3.24.4",
|
|
20
|
-
"@aigne/
|
|
21
|
-
"@aigne/
|
|
22
|
-
"@aigne/
|
|
20
|
+
"@aigne/agent-library": "^1.12.0",
|
|
21
|
+
"@aigne/cli": "^1.11.0",
|
|
22
|
+
"@aigne/core": "^1.18.0",
|
|
23
|
+
"@aigne/openai": "^0.2.1"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@types/bun": "^1.2.9",
|
|
26
|
-
"@aigne/test-utils": "^0.3.
|
|
27
|
+
"@aigne/test-utils": "^0.3.2"
|
|
27
28
|
},
|
|
28
29
|
"scripts": {
|
|
29
30
|
"start": "bun run index.ts",
|
package/usages.ts
CHANGED
|
@@ -9,7 +9,7 @@ const model = new OpenAIChatModel({
|
|
|
9
9
|
apiKey: OPENAI_API_KEY,
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
function
|
|
12
|
+
function transferToB() {
|
|
13
13
|
return agentB;
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -17,7 +17,7 @@ const agentA = AIAgent.from({
|
|
|
17
17
|
name: "AgentA",
|
|
18
18
|
instructions: "You are a helpful agent.",
|
|
19
19
|
outputKey: "A",
|
|
20
|
-
skills: [
|
|
20
|
+
skills: [transferToB],
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
const agentB = AIAgent.from({
|