@aigne/example-workflow-handoff 1.8.1 → 1.9.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.
- package/index.ts +7 -7
- package/package.json +6 -6
- /package/{LICENSE → LICENSE.md} +0 -0
package/index.ts
CHANGED
|
@@ -14,7 +14,7 @@ const execute_order_tool = FunctionAgent.from({
|
|
|
14
14
|
product: z.string(),
|
|
15
15
|
price: z.number(),
|
|
16
16
|
}),
|
|
17
|
-
|
|
17
|
+
process: ({ product, price }: { product: string; price: number }) => {
|
|
18
18
|
console.log("\n\n=== Order Summary ===");
|
|
19
19
|
console.log(`Product: ${product}`);
|
|
20
20
|
console.log(`Price: $${price}`);
|
|
@@ -35,7 +35,7 @@ const look_up_item_tool = FunctionAgent.from({
|
|
|
35
35
|
inputSchema: z.object({
|
|
36
36
|
search_query: z.string(),
|
|
37
37
|
}),
|
|
38
|
-
|
|
38
|
+
process: ({ search_query }: { search_query: string }) => {
|
|
39
39
|
const item_id = "item_132612938";
|
|
40
40
|
console.log(`Found item for: ${search_query}`, item_id);
|
|
41
41
|
return { item_id };
|
|
@@ -49,7 +49,7 @@ const execute_refund_tool = FunctionAgent.from({
|
|
|
49
49
|
item_id: z.string(),
|
|
50
50
|
reason: z.string().optional(),
|
|
51
51
|
}),
|
|
52
|
-
|
|
52
|
+
process: ({ item_id, reason }: { item_id: string; reason?: string }) => {
|
|
53
53
|
console.log("\n\n=== Refund Summary ===");
|
|
54
54
|
console.log(`Item ID: ${item_id}`);
|
|
55
55
|
console.log(`Reason: ${reason ?? "not provided"}`);
|
|
@@ -62,26 +62,26 @@ const execute_refund_tool = FunctionAgent.from({
|
|
|
62
62
|
const transfer_to_issues_and_repairs = FunctionAgent.from({
|
|
63
63
|
name: "transfer_to_issues_and_repairs",
|
|
64
64
|
description: "Use for issues, repairs, or refunds.",
|
|
65
|
-
|
|
65
|
+
process: (): Agent => issuesAndRepairs,
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
const transfer_to_sales_agent = FunctionAgent.from({
|
|
69
69
|
name: "transfer_to_sales_agent",
|
|
70
70
|
description: "Use for anything sales or buying related.",
|
|
71
|
-
|
|
71
|
+
process: (): Agent => sales,
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
const transfer_back_to_triage = FunctionAgent.from({
|
|
75
75
|
name: "transfer_back_to_triage",
|
|
76
76
|
description:
|
|
77
77
|
"Call this if the user brings up a topic outside of your purview,\nincluding escalating to human.",
|
|
78
|
-
|
|
78
|
+
process: (): Agent => triage,
|
|
79
79
|
});
|
|
80
80
|
|
|
81
81
|
const transfer_to_human_manager = FunctionAgent.from({
|
|
82
82
|
name: "transfer_to_human_manager",
|
|
83
83
|
description: "Only call this if explicitly asked to.",
|
|
84
|
-
|
|
84
|
+
process: (): Agent => humanAgent,
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
const sales = AIAgent.from({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/example-workflow-handoff",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.1",
|
|
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",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"README.md"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"openai": "^4.
|
|
20
|
-
"zod": "^3.24.
|
|
21
|
-
"@aigne/
|
|
22
|
-
"@aigne/
|
|
19
|
+
"openai": "^4.97.0",
|
|
20
|
+
"zod": "^3.24.4",
|
|
21
|
+
"@aigne/cli": "^1.9.1",
|
|
22
|
+
"@aigne/core": "^1.15.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@aigne/test-utils": "^0.
|
|
25
|
+
"@aigne/test-utils": "^0.2.0"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"start": "bun run index.ts",
|
/package/{LICENSE → LICENSE.md}
RENAMED
|
File without changes
|