@guava-ai/guava-sdk 0.3.0 → 0.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.
- package/bin/example-runner.js +16 -7
- package/dist/examples/credit-card-activation.js +94 -112
- package/dist/examples/credit-card-activation.js.map +1 -1
- package/dist/examples/property-insurance.js +12 -26
- package/dist/examples/property-insurance.js.map +1 -1
- package/dist/examples/scheduling-outbound.d.ts +1 -0
- package/dist/examples/scheduling-outbound.js +62 -0
- package/dist/examples/scheduling-outbound.js.map +1 -0
- package/dist/examples/thai-palace.js +25 -43
- package/dist/examples/thai-palace.js.map +1 -1
- package/dist/package.json +7 -5
- package/dist/src/action_item.d.ts +34 -12
- package/dist/src/action_item.js +34 -7
- package/dist/src/action_item.js.map +1 -1
- package/dist/src/call-controller.d.ts +137 -0
- package/dist/src/call-controller.js +433 -0
- package/dist/src/call-controller.js.map +1 -0
- package/dist/src/commands.d.ts +67 -27
- package/dist/src/commands.js +41 -27
- package/dist/src/commands.js.map +1 -1
- package/dist/src/events.d.ts +47 -30
- package/dist/src/events.js +42 -36
- package/dist/src/events.js.map +1 -1
- package/dist/src/example_data.d.ts +1 -0
- package/dist/src/example_data.js +33 -0
- package/dist/src/example_data.js.map +1 -1
- package/dist/src/helpers/openai.d.ts +12 -1
- package/dist/src/helpers/openai.js +168 -68
- package/dist/src/helpers/openai.js.map +1 -1
- package/dist/src/index.d.ts +6 -121
- package/dist/src/index.js +249 -483
- package/dist/src/index.js.map +1 -1
- package/dist/src/logging.d.ts +2 -1
- package/dist/src/logging.js +32 -7
- package/dist/src/logging.js.map +1 -1
- package/dist/src/telemetry.d.ts +23 -0
- package/dist/src/telemetry.js +98 -0
- package/dist/src/telemetry.js.map +1 -0
- package/dist/src/utils.d.ts +3 -0
- package/dist/src/utils.js +28 -0
- package/dist/src/utils.js.map +1 -0
- package/examples/biome.json +5 -0
- package/examples/credit-card-activation.ts +20 -26
- package/examples/property-insurance.ts +6 -16
- package/examples/scheduling-outbound.ts +80 -0
- package/examples/thai-palace.ts +10 -13
- package/package.json +7 -5
- package/src/action_item.ts +53 -13
- package/src/call-controller.ts +451 -0
- package/src/commands.ts +58 -42
- package/src/events.ts +66 -51
- package/src/example_data.ts +42 -0
- package/src/helpers/openai.ts +73 -18
- package/src/index.ts +81 -403
- package/src/logging.ts +39 -7
- package/src/telemetry.ts +125 -0
- package/src/utils.ts +32 -0
package/bin/example-runner.js
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { readdirSync } from "node:fs";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const examplesURL = new URL("../dist/examples/", import.meta.url);
|
|
7
|
+
const examplesDir = fileURLToPath(examplesURL);
|
|
8
|
+
const availableExamples = readdirSync(examplesDir).filter(f => f.endsWith(".js")).map(f => f.replace(/\.js$/, ""));
|
|
9
|
+
|
|
3
10
|
const exampleName = process.argv[2];
|
|
4
11
|
if (!exampleName) {
|
|
5
12
|
console.error("Usage: guava-example <example-name> <example-args>");
|
|
13
|
+
console.error("Available examples:", availableExamples.join(", "))
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (!availableExamples.includes(exampleName)) {
|
|
18
|
+
console.error(`Unknown example "${exampleName}". Available examples: ${availableExamples.join(", ")}`);
|
|
6
19
|
process.exit(1);
|
|
7
20
|
}
|
|
8
21
|
|
|
9
22
|
const run = async () => {
|
|
10
23
|
try {
|
|
11
24
|
// ESM dynamic import works in both ESM packages and CJS CLI files in modern Node
|
|
12
|
-
const exampleModule = await import(new URL(
|
|
13
|
-
exampleModule.run(process.argv.slice(3))
|
|
25
|
+
const exampleModule = await import(new URL(`${exampleName}.js`, examplesURL));
|
|
26
|
+
await exampleModule.run(process.argv.slice(3));
|
|
14
27
|
} catch (err) {
|
|
15
|
-
|
|
16
|
-
console.error(`Couldn't find example: ${exampleName}`)
|
|
17
|
-
} else {
|
|
18
|
-
console.error(err);
|
|
19
|
-
}
|
|
28
|
+
console.error(err);
|
|
20
29
|
process.exit(1);
|
|
21
30
|
}
|
|
22
31
|
};
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import { IntentRecognizer } from "../src/helpers/openai.js";
|
|
11
2
|
import * as guava from "../src/index.js";
|
|
12
3
|
const CUSTOMER_DB = [
|
|
@@ -19,13 +10,14 @@ const CUSTOMER_DB = [
|
|
|
19
10
|
},
|
|
20
11
|
];
|
|
21
12
|
function findCustomerBySSN(ssn) {
|
|
22
|
-
return CUSTOMER_DB.find((c) => c.ssn
|
|
13
|
+
return CUSTOMER_DB.find((c) => c.ssn === ssn);
|
|
23
14
|
}
|
|
24
15
|
const ORGANIZATION_NAME = "Harper Valley Bank";
|
|
25
16
|
class CreditCardActivationController extends guava.CallController {
|
|
17
|
+
choices = ["activate credit card", "anything else"];
|
|
18
|
+
intentRecognizer;
|
|
26
19
|
constructor(logger) {
|
|
27
20
|
super(logger);
|
|
28
|
-
this.choices = ["activate credit card", "anything else"];
|
|
29
21
|
this.intentRecognizer = new IntentRecognizer(this.choices, logger);
|
|
30
22
|
this.setPersona({
|
|
31
23
|
organizationName: ORGANIZATION_NAME,
|
|
@@ -34,125 +26,115 @@ class CreditCardActivationController extends guava.CallController {
|
|
|
34
26
|
this.readScript(`Hello, thank you for calling the credit card activation line for ${ORGANIZATION_NAME}. My name is Grace. Are you here to activate your credit card?`);
|
|
35
27
|
this.acceptCall();
|
|
36
28
|
}
|
|
37
|
-
onIntent(intent) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
29
|
+
async onIntent(intent) {
|
|
30
|
+
const choice = await this.intentRecognizer.classify(intent);
|
|
31
|
+
this.logger.info(`Chosen intent: ${choice}`);
|
|
32
|
+
if (choice === "activate credit card") {
|
|
33
|
+
await this.activateCreditCard();
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return "Unfortunately I'm not able to help with that.";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async findCustomer() {
|
|
41
|
+
let customer;
|
|
42
|
+
let cardNumber;
|
|
43
|
+
while (true) {
|
|
44
|
+
await this.awaitTask({
|
|
45
|
+
checklist: [
|
|
46
|
+
guava.Field({
|
|
47
|
+
description: "Could you give me your social security number?",
|
|
48
|
+
key: "social_security_number",
|
|
49
|
+
fieldType: "integer",
|
|
50
|
+
required: true,
|
|
51
|
+
}),
|
|
52
|
+
],
|
|
53
|
+
});
|
|
54
|
+
const ssn_data = this.getField("social_security_number");
|
|
55
|
+
let ssn;
|
|
56
|
+
if (typeof ssn_data === "string") {
|
|
57
|
+
ssn = ssn_data;
|
|
44
58
|
}
|
|
45
59
|
else {
|
|
46
|
-
|
|
60
|
+
// Should we assume all payloads are strings? or leave room by returning unknown
|
|
61
|
+
ssn = JSON.stringify(ssn_data);
|
|
47
62
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
let customer;
|
|
53
|
-
let cardNumber;
|
|
54
|
-
while (true) {
|
|
55
|
-
yield this.awaitTask({
|
|
56
|
-
checklist: [
|
|
57
|
-
{
|
|
58
|
-
item_type: "field",
|
|
59
|
-
description: "Could you give me your social security number?",
|
|
60
|
-
key: "social_security_number",
|
|
61
|
-
field_type: "integer",
|
|
62
|
-
required: true,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
});
|
|
66
|
-
const ssn_data = this.getField("social_security_number");
|
|
67
|
-
let ssn;
|
|
68
|
-
if (typeof ssn_data == "string") {
|
|
69
|
-
ssn = ssn_data;
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
// Should we assume all payloads are strings? or leave room by returning unknown
|
|
73
|
-
ssn = JSON.stringify(ssn_data);
|
|
74
|
-
}
|
|
75
|
-
customer = findCustomerBySSN(ssn);
|
|
76
|
-
if (!customer) {
|
|
77
|
-
this.sendInstruction("We were unable to identify the customer using the SSN they provided. Let the caller know this, and ask if they have the correct social security number.");
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
yield this.awaitTask({
|
|
81
|
-
objective: "We were able to identify the customer using the Social Security Number they have provided. We're going to confirm the client's name.",
|
|
82
|
-
checklist: [
|
|
83
|
-
{
|
|
84
|
-
item_type: "field",
|
|
85
|
-
description: `We're going to confirm the client's name. Am I speaking with ${customer.name}?`,
|
|
86
|
-
key: "is_client",
|
|
87
|
-
field_type: "multiple_choice",
|
|
88
|
-
choices: ["yes", "no"],
|
|
89
|
-
required: true,
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
});
|
|
93
|
-
if (this.getField("is_client") == "no") {
|
|
94
|
-
this.sendInstruction("We were unable to identify the client's name in our files. Let the caller know this, and re-ask their social security number.");
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
63
|
+
customer = findCustomerBySSN(ssn);
|
|
64
|
+
if (!customer) {
|
|
65
|
+
this.sendInstruction("We were unable to identify the customer using the SSN they provided. Let the caller know this, and ask if they have the correct social security number.");
|
|
100
66
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
67
|
+
else {
|
|
68
|
+
await this.awaitTask({
|
|
69
|
+
objective: "We were able to identify the customer using the Social Security Number they have provided. We're going to confirm the client's name.",
|
|
104
70
|
checklist: [
|
|
105
|
-
{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
71
|
+
guava.Field({
|
|
72
|
+
description: `We're going to confirm the client's name. Am I speaking with ${customer.name}?`,
|
|
73
|
+
key: "is_client",
|
|
74
|
+
fieldType: "multiple_choice",
|
|
75
|
+
choices: ["yes", "no"],
|
|
110
76
|
required: true,
|
|
111
|
-
},
|
|
77
|
+
}),
|
|
112
78
|
],
|
|
113
79
|
});
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this.sendInstruction("We were unable to find the matching card number in our system. Let the caller know this, and re-ask for the credit card number.");
|
|
80
|
+
if (this.getField("is_client") === "no") {
|
|
81
|
+
this.sendInstruction("We were unable to identify the client's name in our files. Let the caller know this, and re-ask their social security number.");
|
|
117
82
|
}
|
|
118
83
|
else {
|
|
119
|
-
this.sendInstruction("We were able to find the matching card number in our system. Let the caller know this, and ask for security code on their card.");
|
|
120
84
|
break;
|
|
121
85
|
}
|
|
122
86
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
87
|
+
}
|
|
88
|
+
this.sendInstruction("We were able to find the client's name in our files. Proceed to ask for their card number.");
|
|
89
|
+
while (true) {
|
|
90
|
+
await this.awaitTask({
|
|
91
|
+
checklist: [
|
|
92
|
+
guava.Field({
|
|
93
|
+
fieldType: "integer",
|
|
94
|
+
description: "Could you read me the digits on the front of your credit card?",
|
|
95
|
+
key: "credit_card_number",
|
|
96
|
+
required: true,
|
|
97
|
+
}),
|
|
98
|
+
],
|
|
99
|
+
});
|
|
100
|
+
cardNumber = this.getField("credit_card_number");
|
|
101
|
+
if (!(cardNumber in customer.unactivated_cards)) {
|
|
102
|
+
this.sendInstruction("We were unable to find the matching card number in our system. Let the caller know this, and re-ask for the credit card number.");
|
|
143
103
|
}
|
|
144
|
-
|
|
145
|
-
|
|
104
|
+
else {
|
|
105
|
+
this.sendInstruction("We were able to find the matching card number in our system. Let the caller know this, and ask for security code on their card.");
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const correctCvv = customer.unactivated_cards[cardNumber];
|
|
110
|
+
while (true) {
|
|
111
|
+
await this.awaitTask({
|
|
112
|
+
checklist: [
|
|
113
|
+
guava.Field({
|
|
114
|
+
fieldType: "integer",
|
|
115
|
+
key: "security_code",
|
|
116
|
+
description: "To wrap up, could I get the security code on your card?",
|
|
117
|
+
required: true,
|
|
118
|
+
}),
|
|
119
|
+
],
|
|
120
|
+
});
|
|
121
|
+
const security_code = this.getField("security_code");
|
|
122
|
+
if (security_code !== correctCvv.toString()) {
|
|
123
|
+
this.sendInstruction("We were unable to match the security code to the credit card. Let the caller know this and re-ask for the security code.");
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
this.hangup("Explain to the caller that their credit card has now been activated. Thank them for using the bank's services, and hang up.");
|
|
146
130
|
}
|
|
147
|
-
activateCreditCard() {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
yield this.findCustomer();
|
|
151
|
-
});
|
|
131
|
+
async activateCreditCard() {
|
|
132
|
+
this.sendInstruction("We are starting the credit card activation process, which starts with asking the caller for their social security number.");
|
|
133
|
+
await this.findCustomer();
|
|
152
134
|
}
|
|
153
135
|
}
|
|
154
136
|
export function run(_args) {
|
|
155
|
-
|
|
137
|
+
new guava.Client().listenInbound({
|
|
156
138
|
agent_number: process.env.GUAVA_AGENT_NUMBER,
|
|
157
139
|
}, (logger) => new CreditCardActivationController(logger));
|
|
158
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit-card-activation.js","sourceRoot":"","sources":["../../examples/credit-card-activation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"credit-card-activation.js","sourceRoot":"","sources":["../../examples/credit-card-activation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AASzC,MAAM,WAAW,GAAe;IAC9B;QACE,IAAI,EAAE,YAAY;QAClB,GAAG,EAAE,WAAW;QAChB,iBAAiB,EAAE;YACjB,kBAAkB,EAAE,GAAG;SACxB;KACF;CACF,CAAC;AAEF,SAAS,iBAAiB,CAAC,GAAW;IACpC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAE/C,MAAM,8BAA+B,SAAQ,KAAK,CAAC,cAAc;IACvD,OAAO,GAAG,CAAC,sBAAsB,EAAE,eAAe,CAAU,CAAC;IAC7D,gBAAgB,CAAwC;IAChE,YAAY,MAAc;QACxB,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,CAAC;YACd,gBAAgB,EAAE,iBAAiB;YACnC,YAAY,EAAE,uFAAuF,iBAAiB,GAAG;SAC1H,CAAC,CAAC;QACH,IAAI,CAAC,UAAU,CACb,oEAAoE,iBAAiB,gEAAgE,CACtJ,CAAC;QACF,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAEQ,KAAK,CAAC,QAAQ,CAAC,MA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C;wBACV,SAAS,EAAE,SAAS;wBACpB,GAAG,EAAE,eAAe;wBACpB,WAAW,EAAE,yDAAyD;wBACtE,QAAQ,EAAE,IAAI;qBACf,CAAC;iBACH;aACF,CAAC,CAAC;YAEH,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAW,CAAC;YAC/D,IAAI,aAAa,KAAK,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC;gBAC5C,IAAI,CAAC,eAAe,CAClB,0HAA0H,CAC3H,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,MAAM;YACR,CAAC;QACH,CAAC;QACD,IAAI,CAAC,MAAM,CACT,6HAA6H,CAC9H,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,IAAI,CAAC,eAAe,CAClB,2HAA2H,CAC5H,CAAC;QAEF,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;CACF;AAED,MAAM,UAAU,GAAG,CAAC,KAAe;IACjC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,aAAa,CAC9B;QACE,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAmB;KAC9C,EACD,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,8BAA8B,CAAC,MAAM,CAAC,CACvD,CAAC;AACJ,CAAC;AAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,GAAG,CAAC,EAAE,CAAC,CAAC;AACV,CAAC"}
|
|
@@ -1,35 +1,21 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import * as guava from "../src/index.js";
|
|
11
2
|
import { DocumentQA } from "../src/helpers/openai.js";
|
|
12
3
|
import { PROPERTY_INSURANCE_POLICY } from "../src/example_data.js";
|
|
13
4
|
class InsuranceCallController extends guava.CallController {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
yield this.setPersona({
|
|
21
|
-
organizationName: "Harper Valley Property Insurance",
|
|
22
|
-
});
|
|
23
|
-
this.setTask({
|
|
24
|
-
objective: "You are making an outbound call to a potential customer. Your task is to answer questions regarding property insurance policy until there are no more questions.",
|
|
25
|
-
});
|
|
5
|
+
documentQA;
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.documentQA = new DocumentQA("harper-valley-property-insurance", PROPERTY_INSURANCE_POLICY);
|
|
9
|
+
this.setPersona({
|
|
10
|
+
organizationName: "Harper Valley Property Insurance",
|
|
26
11
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
return yield this.documentQA.ask(question);
|
|
12
|
+
this.setTask({
|
|
13
|
+
objective: "You are making an outbound call to a potential customer. Your task is to answer questions regarding property insurance policy until there are no more questions.",
|
|
31
14
|
});
|
|
32
15
|
}
|
|
16
|
+
async onQuestion(question) {
|
|
17
|
+
return await this.documentQA.ask(question);
|
|
18
|
+
}
|
|
33
19
|
}
|
|
34
20
|
export function run(args) {
|
|
35
21
|
const [phone] = args;
|
|
@@ -37,7 +23,7 @@ export function run(args) {
|
|
|
37
23
|
console.error("Usage: guava-example property-insurance <phone>");
|
|
38
24
|
process.exit(1);
|
|
39
25
|
}
|
|
40
|
-
new guava.Client().createOutbound(process.env.GUAVA_AGENT_NUMBER, phone,
|
|
26
|
+
new guava.Client().createOutbound(process.env.GUAVA_AGENT_NUMBER, phone, new InsuranceCallController());
|
|
41
27
|
}
|
|
42
28
|
if (import.meta.main) {
|
|
43
29
|
run(process.argv.slice(2));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-insurance.js","sourceRoot":"","sources":["../../examples/property-insurance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"property-insurance.js","sourceRoot":"","sources":["../../examples/property-insurance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,MAAM,uBAAwB,SAAQ,KAAK,CAAC,cAAc;IAChD,UAAU,CAAa;IAC/B;QACE,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,kCAAkC,EAAE,yBAAyB,CAAC,CAAC;QAEhG,IAAI,CAAC,UAAU,CAAC;YACd,gBAAgB,EAAE,kCAAkC;SACrD,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,CAAC;YACX,SAAS,EACP,kKAAkK;SACrK,CAAC,CAAC;IACL,CAAC;IAEQ,KAAK,CAAC,UAAU,CAAC,QAAgB;QACxC,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,MAAM,UAAU,GAAG,CAAC,IAAc;IAChC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAErB,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,cAAc,CAC/B,OAAO,CAAC,GAAG,CAAC,kBAAmB,EAC/B,KAAK,EACL,IAAI,uBAAuB,EAAE,CAC9B,CAAC;AACJ,CAAC;AAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function run(args: string[]): void;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as guava from "../src/index.js";
|
|
2
|
+
import { DatetimeFilter } from "../src/helpers/openai.js";
|
|
3
|
+
import { mockAppointmentsForFuture } from "../src/example_data.js";
|
|
4
|
+
class SchedulingController extends guava.CallController {
|
|
5
|
+
patientName;
|
|
6
|
+
datetimeFilter;
|
|
7
|
+
constructor(patientName) {
|
|
8
|
+
super();
|
|
9
|
+
this.patientName = patientName;
|
|
10
|
+
this.datetimeFilter = new DatetimeFilter({
|
|
11
|
+
sourceList: mockAppointmentsForFuture(),
|
|
12
|
+
});
|
|
13
|
+
this.setPersona({
|
|
14
|
+
organizationName: "Bright Smile Dental",
|
|
15
|
+
agentName: "Grace",
|
|
16
|
+
agentPurpose: `You are calling ${patientName} to help them schedule a dental appointment`,
|
|
17
|
+
});
|
|
18
|
+
this.reachPerson(this.patientName, {
|
|
19
|
+
onSuccess: () => this.scheduleRecipient(),
|
|
20
|
+
onFailure: () => this.recipientUnavailable(),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
scheduleRecipient() {
|
|
24
|
+
this.setTask({
|
|
25
|
+
checklist: [
|
|
26
|
+
guava.Say("Let me look to see what appointment times we have available."),
|
|
27
|
+
guava.Field({
|
|
28
|
+
key: "appointment_time",
|
|
29
|
+
fieldType: "calendar_slot",
|
|
30
|
+
description: "Find a time that works for the caller",
|
|
31
|
+
choiceGenerator: async (query) => {
|
|
32
|
+
const result = await this.datetimeFilter.filter(query, { maxResults: 3 });
|
|
33
|
+
this.logger.info("Choice generator results: %s", JSON.stringify(result));
|
|
34
|
+
return result;
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
guava.Say("Your appointment has been confirmed! Have a nice day."),
|
|
38
|
+
],
|
|
39
|
+
}, () => this.hangup("Thank them for their time and hang up the call."));
|
|
40
|
+
}
|
|
41
|
+
recipientUnavailable() {
|
|
42
|
+
this.hangup("Apologize for your mistake and hang up the call.");
|
|
43
|
+
}
|
|
44
|
+
onSessionDone() {
|
|
45
|
+
const selectedTime = this.getField("appointment_time");
|
|
46
|
+
if (selectedTime) {
|
|
47
|
+
this.logger.info(`Appointment confirmed for: ${selectedTime}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export function run(args) {
|
|
52
|
+
const [toNumber, patientName = "Benjamin Buttons"] = args;
|
|
53
|
+
if (!toNumber) {
|
|
54
|
+
console.error("Usage: guava-example scheduling-outbound <phone> [name]");
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
new guava.Client().createOutbound(process.env.GUAVA_AGENT_NUMBER, toNumber, new SchedulingController(patientName));
|
|
58
|
+
}
|
|
59
|
+
if (import.meta.main) {
|
|
60
|
+
run(process.argv.slice(2));
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=scheduling-outbound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduling-outbound.js","sourceRoot":"","sources":["../../examples/scheduling-outbound.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,MAAM,oBAAqB,SAAQ,KAAK,CAAC,cAAc;IACpC,WAAW,CAAS;IACpB,cAAc,CAAiB;IAEhD,YAAY,WAAmB;QAC7B,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,W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CAAC;IAEQ,aAAa;QACpB,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;QACvD,IAAI,YAAY,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,8BAA8B,YAAY,EAAE,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;CACF;AAED,MAAM,UAAU,GAAG,CAAC,IAAc;IAChC,MAAM,CAAC,QAAQ,EAAE,WAAW,GAAG,kBAAkB,CAAC,GAAG,IAAI,CAAC;IAE1D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,cAAc,CAC/B,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAC9B,QAAQ,EACR,IAAI,oBAAoB,CAAC,WAAW,CAAC,CACtC,CAAC;AACJ,CAAC;AAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -1,73 +1,55 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import * as guava from "../src/index.js";
|
|
11
2
|
import { getConsoleLogger } from "../src/logging.js";
|
|
12
3
|
import { IntentRecognizer } from "../src/helpers/openai.js";
|
|
13
4
|
class ThaiPalaceCallController extends guava.CallController {
|
|
5
|
+
choices = ["restaurant waitlist", "anything else"];
|
|
6
|
+
intentRecognizer;
|
|
14
7
|
constructor(logger) {
|
|
15
8
|
super(logger);
|
|
16
|
-
this.choices = ["restaurant waitlist", "anything else"];
|
|
17
9
|
this.intentRecognizer = new IntentRecognizer(this.choices, logger);
|
|
18
10
|
this.setPersona({
|
|
19
11
|
organizationName: "Thai Palace",
|
|
20
12
|
});
|
|
21
13
|
}
|
|
22
|
-
onIncomingCall(from_number) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
yield _super.onIncomingCall.call(this, from_number);
|
|
28
|
-
this.acceptCall();
|
|
29
|
-
this.setThaiPalaceTask();
|
|
30
|
-
});
|
|
14
|
+
async onIncomingCall(from_number) {
|
|
15
|
+
await super.onIncomingCall(from_number);
|
|
16
|
+
this.acceptCall();
|
|
17
|
+
this.setThaiPalaceTask();
|
|
31
18
|
}
|
|
32
19
|
setThaiPalaceTask() {
|
|
33
20
|
this.setTask({
|
|
34
21
|
objective: `You are a virtual assistant for a restaurant called Thai Palace.
|
|
35
22
|
Your job is to add callers to the waitlist.`,
|
|
36
23
|
checklist: [
|
|
37
|
-
{
|
|
38
|
-
item_type: "field",
|
|
24
|
+
guava.Field({
|
|
39
25
|
key: "caller_name",
|
|
40
|
-
|
|
26
|
+
fieldType: "text",
|
|
41
27
|
description: "The name to be added to the waitlist",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
item_type: "field",
|
|
28
|
+
}),
|
|
29
|
+
guava.Field({
|
|
45
30
|
key: "party_size",
|
|
46
|
-
|
|
31
|
+
fieldType: "integer",
|
|
47
32
|
description: "The number of people attending",
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
item_type: "field",
|
|
33
|
+
}),
|
|
34
|
+
guava.Field({
|
|
51
35
|
key: "phone_number",
|
|
52
|
-
|
|
36
|
+
fieldType: "text",
|
|
53
37
|
description: "phone number to text when table is ready",
|
|
54
|
-
},
|
|
38
|
+
}),
|
|
55
39
|
"Read the phone number back to the caller to make sure you got it right",
|
|
56
40
|
],
|
|
57
41
|
}, () => this.hangup());
|
|
58
42
|
}
|
|
59
|
-
onIntent(intent) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
});
|
|
43
|
+
async onIntent(intent) {
|
|
44
|
+
const choice = await this.intentRecognizer.classify(intent);
|
|
45
|
+
this.logger.info(`Chosen intent: ${choice}`);
|
|
46
|
+
if (choice === "restaurant waitlist") {
|
|
47
|
+
this.setThaiPalaceTask();
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return "Tell them we only handle waitlist additions at this number.";
|
|
52
|
+
}
|
|
71
53
|
}
|
|
72
54
|
}
|
|
73
55
|
export function run(_args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thai-palace.js","sourceRoot":"","sources":["../../examples/thai-palace.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"thai-palace.js","sourceRoot":"","sources":["../../examples/thai-palace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAe,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,wBAAyB,SAAQ,KAAK,CAAC,cAAc;IACjD,OAAO,GAAG,CAAC,qBAAqB,EAAE,eAAe,CAAU,CAAC;IAC5D,gBAAgB,CAAwC;IAChE,YAAY,MAAc;QACx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IAAI,CAAC;QACd,CAAC;aAAM,CAAC;YACN,OAAO,6DAA6D,CAAC;QACvE,CAAC;IACH,CAAC;CACF;AAED,MAAM,UAAU,GAAG,CAAC,KAAe;IACjC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,aAAa,CAC9B,EAAE,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAmB,EAAE,EACjD,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,wBAAwB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CACpE,CAAC;AACJ,CAAC;AAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,GAAG,CAAC,EAAE,CAAC,CAAC;AACV,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guava-ai/guava-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"@biomejs/biome": "2.3.11",
|
|
9
9
|
"@types/node": "^25.0.7",
|
|
10
10
|
"@types/ws": "^8.18.1",
|
|
11
|
+
"tsx": "^4.21.0",
|
|
11
12
|
"typescript": "^5.9.3"
|
|
12
13
|
},
|
|
13
14
|
"bin": {
|
|
@@ -20,10 +21,11 @@
|
|
|
20
21
|
},
|
|
21
22
|
"scripts": {
|
|
22
23
|
"typecheck": "tsc --noEmit",
|
|
23
|
-
"lint": "biome lint",
|
|
24
|
-
"
|
|
25
|
-
"format
|
|
26
|
-
"
|
|
24
|
+
"lint": "biome lint --max-diagnostics=none",
|
|
25
|
+
"lint-fix": "biome lint --max-diagnostics=none --write",
|
|
26
|
+
"check-format": "biome format ./src ./examples",
|
|
27
|
+
"format": "biome format --write ./src ./examples",
|
|
28
|
+
"check": "npm run typecheck && npm audit && npm run lint && npm run check-format",
|
|
27
29
|
"clean": "rm -rf ./dist",
|
|
28
30
|
"build": "tsc",
|
|
29
31
|
"prepublishOnly": "npm run clean && npm run build"
|