@guava-ai/guava-sdk 0.6.0 → 0.8.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/README.md +1 -1
- package/dist/bin/example-runner.js +0 -0
- package/dist/examples/property-insurance.js +5 -4
- package/dist/examples/property-insurance.js.map +1 -1
- package/dist/examples/scheduling-outbound.js +12 -12
- package/dist/examples/scheduling-outbound.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +6 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/version.d.ts +1 -0
- package/dist/src/version.js +5 -0
- package/dist/src/version.js.map +1 -0
- package/examples/credit-card-activation.ts +3 -3
- package/examples/property-insurance.ts +3 -3
- package/examples/scheduling-outbound.ts +15 -15
- package/examples/thai-palace.ts +3 -3
- package/package.json +3 -3
- package/src/helpers/openai.ts +2 -1
- package/src/index.ts +5 -4
- package/src/utils.ts +1 -1
- package/src/version.ts +1 -0
- package/dist/package.json +0 -58
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ $ export GUAVA_AGENT_NUMBER="..." # A phone number for your agent to use.
|
|
|
17
17
|
|
|
18
18
|
Run an outbound phone call example using `npx`. Replace the phone number with your own and your agent will call you.
|
|
19
19
|
```bash
|
|
20
|
-
$ npx @guava-ai/guava-sdk scheduling-outbound +15556667777 # Your agent will call this number.
|
|
20
|
+
$ npx @guava-ai/guava-sdk@latest scheduling-outbound +15556667777 # Your agent will call this number.
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Installation
|
|
File without changes
|
|
@@ -34,14 +34,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.run = run;
|
|
37
|
-
const guava = __importStar(require("
|
|
38
|
-
const
|
|
39
|
-
const
|
|
37
|
+
const guava = __importStar(require("@guava-ai/guava-sdk"));
|
|
38
|
+
const openai_1 = require("@guava-ai/guava-sdk/helpers/openai");
|
|
39
|
+
const example_data_1 = require("@guava-ai/guava-sdk/example-data");
|
|
40
|
+
console.log(guava.CANARY);
|
|
40
41
|
class InsuranceCallController extends guava.CallController {
|
|
41
42
|
documentQA;
|
|
42
43
|
constructor() {
|
|
43
44
|
super();
|
|
44
|
-
this.documentQA = new
|
|
45
|
+
this.documentQA = new openai_1.DocumentQA("harper-valley-property-insurance", example_data_1.PROPERTY_INSURANCE_POLICY);
|
|
45
46
|
this.setPersona({
|
|
46
47
|
organizationName: "Harper Valley Property Insurance",
|
|
47
48
|
});
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,kBAaC;AAxCD,2DAA6C;AAC7C,+DAAgE;AAChE,mEAA6E;AAE7E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;AAEzB,MAAM,uBAAwB,SAAQ,KAAK,CAAC,cAAc;IAChD,UAAU,CAAa;IAC/B;QACE,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,UAAU,GAAG,IAAI,mBAAU,CAAC,kCAAkC,EAAE,wCAAyB,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;AAEM,KAAK,UAAU,GAAG,CAAC,IAAc;IACtC,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"}
|
|
@@ -48,7 +48,7 @@ class SchedulingController extends guava.CallController {
|
|
|
48
48
|
this.datetimeFilter = new openai_ts_1.DatetimeFilter({
|
|
49
49
|
sourceList: (0, example_data_ts_1.mockAppointmentsForFuture)(),
|
|
50
50
|
});
|
|
51
|
-
// Use setPersona to set basic information about the agent, as well as
|
|
51
|
+
// Use setPersona to set basic information about the agent, as well as its high-level purpose.
|
|
52
52
|
this.setPersona({
|
|
53
53
|
organizationName: "Bright Smile Dental",
|
|
54
54
|
agentName: "Grace",
|
|
@@ -61,30 +61,30 @@ class SchedulingController extends guava.CallController {
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
scheduleRecipient() {
|
|
64
|
-
//
|
|
65
|
-
//
|
|
64
|
+
// We have now confirmed that we are talking to the patient.
|
|
65
|
+
// Set the Agent's current task to collect the desired appointment time.
|
|
66
66
|
this.setTask({
|
|
67
67
|
// The check list is an ordered list of items for the agent to go through.
|
|
68
|
+
// It can include short prompts as well as Fields to capture structured information.
|
|
68
69
|
checklist: [
|
|
69
|
-
|
|
70
|
-
guava.Say("Let me look to see what appointment times we have available."),
|
|
70
|
+
"tell them that it's been a while since their regular cleaning with Dr. Teeth, and ask if they would like to schedule an appointment now.",
|
|
71
71
|
// We have one field to collect, which is the appointment_time.
|
|
72
72
|
guava.Field({
|
|
73
73
|
key: "appointment_time",
|
|
74
74
|
fieldType: "calendar_slot",
|
|
75
75
|
description: "Find a time that works for the caller",
|
|
76
|
-
//
|
|
77
|
-
// with a
|
|
78
|
-
//
|
|
79
|
-
// or provides a new query.
|
|
76
|
+
// The choiceGenerator will be called when negotiating a calendar slot.
|
|
77
|
+
// We respond with a list of datetime options based on the user's
|
|
78
|
+
// criteria, which is summarized in the query string.
|
|
80
79
|
choiceGenerator: async (query) => {
|
|
81
|
-
//
|
|
80
|
+
// Query will have some natural language preferences like "early morning" or
|
|
81
|
+
// "next week". The dateTime filter queries our calendar for matching slots.
|
|
82
82
|
const result = await this.datetimeFilter.filter(query, { maxResults: 3 });
|
|
83
|
-
this.logger.info("
|
|
83
|
+
this.logger.info("Appointment slot matches: %s", JSON.stringify(result));
|
|
84
84
|
return result;
|
|
85
85
|
},
|
|
86
86
|
}),
|
|
87
|
-
|
|
87
|
+
"tell them their appointment has been confirmed and answer any questions before ending the call.",
|
|
88
88
|
],
|
|
89
89
|
}, () => this.hangup("Thank them for their time and hang up the call."));
|
|
90
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduling-outbound.js","sourceRoot":"","sources":["../../examples/scheduling-outbound.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EA,kBAaC;AA5FD,uDAAyC;AACzC,wDAA0D;AAC1D,4DAAmE;AAEnE,MAAM,oBAAqB,SAAQ,KAAK,CAAC,cAAc;IACpC,WAAW,CAAS;IACpB,cAAc,CAAiB;IAEhD,YAAY,WAAmB;QAC7B,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAE/B,yFAAyF;QACzF,yFAAyF;QACzF,IAAI,CAAC,cAAc,GAAG,IAAI,0BAAc,CAAC;YACvC,UAAU,EAAE,IAAA,2CAAyB,GAAE;SACxC,CAAC,CAAC;QAEH
|
|
1
|
+
{"version":3,"file":"scheduling-outbound.js","sourceRoot":"","sources":["../../examples/scheduling-outbound.ts"],"names":[],"m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,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;wBAC1E,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,8BAA8B,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;wBACzE,OAAO,MAAM,CAAC;oBAChB,CAAC;iBACF,CAAC;gBACF,iGAAiG;aAClG;SACF,EACD,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,iDAAiD,CAAC,CACrE,CAAC;IACJ,CAAC;IAEO,oBAAoB;QAC1B,IAAI,CAAC,MAAM,CAAC,kDAAkD,CAAC,CAAC;IAClE,CAAC;IAEQ,aAAa;QACpB,0DAA0D;QAC1D,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;AAEM,KAAK,UAAU,GAAG,CAAC,IAAc;IACtC,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"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type Logger } from "./logging.ts";
|
|
|
3
3
|
import type { CallController } from "./call-controller.ts";
|
|
4
4
|
export { CallController, type TaskObjective } from "./call-controller.ts";
|
|
5
5
|
export { Say, Field } from "./action_item.ts";
|
|
6
|
+
export declare const CANARY = "TEST";
|
|
6
7
|
export type InboundConnection = {
|
|
7
8
|
agent_number: string;
|
|
8
9
|
} | {
|
package/dist/src/index.js
CHANGED
|
@@ -70,13 +70,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
70
70
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
71
71
|
};
|
|
72
72
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
73
|
-
exports.Client = exports.Field = exports.Say = exports.CallController = void 0;
|
|
73
|
+
exports.Client = exports.CANARY = exports.Field = exports.Say = exports.CallController = void 0;
|
|
74
74
|
const ws_1 = __importDefault(require("ws"));
|
|
75
75
|
const logging_ts_1 = require("./logging.js");
|
|
76
76
|
const commands_ts_1 = require("./commands.js");
|
|
77
77
|
const z = __importStar(require("zod"));
|
|
78
78
|
const events_ts_1 = require("./events.js");
|
|
79
|
-
const
|
|
79
|
+
const version_ts_1 = require("./version.js");
|
|
80
80
|
const node_os_1 = __importDefault(require("node:os"));
|
|
81
81
|
const utils_ts_1 = require("./utils.js");
|
|
82
82
|
const telemetry_ts_1 = require("./telemetry.js");
|
|
@@ -86,6 +86,7 @@ var action_item_ts_1 = require("./action_item.js");
|
|
|
86
86
|
Object.defineProperty(exports, "Say", { enumerable: true, get: function () { return action_item_ts_1.Say; } });
|
|
87
87
|
Object.defineProperty(exports, "Field", { enumerable: true, get: function () { return action_item_ts_1.Field; } });
|
|
88
88
|
const SDK_NAME = "typescript-sdk";
|
|
89
|
+
exports.CANARY = "TEST";
|
|
89
90
|
let firstClient = false;
|
|
90
91
|
/**
|
|
91
92
|
* @description convenience function for stringifying data according to a schema
|
|
@@ -172,15 +173,15 @@ let Client = (() => {
|
|
|
172
173
|
"x-guava-runtime": process.release.name,
|
|
173
174
|
"x-guava-runtime-version": process.version,
|
|
174
175
|
"x-guava-sdk": SDK_NAME,
|
|
175
|
-
"x-guava-sdk-version":
|
|
176
|
+
"x-guava-sdk-version": version_ts_1.SDK_VERSION,
|
|
176
177
|
};
|
|
177
178
|
}
|
|
178
179
|
async _checkSdkDeprecation() {
|
|
179
|
-
this._logger.debug(`Checking deprecation for SDK ${SDK_NAME}, ${
|
|
180
|
+
this._logger.debug(`Checking deprecation for SDK ${SDK_NAME}, ${version_ts_1.SDK_VERSION}.`);
|
|
180
181
|
try {
|
|
181
182
|
const url = new URL("v1/check-sdk-deprecation", this.getHttpBase());
|
|
182
183
|
url.searchParams.set("sdk_name", SDK_NAME);
|
|
183
|
-
url.searchParams.set("sdk_version",
|
|
184
|
+
url.searchParams.set("sdk_version", version_ts_1.SDK_VERSION);
|
|
184
185
|
const response = await (0, utils_ts_1.fetchOrThrow)(url, {
|
|
185
186
|
method: "POST",
|
|
186
187
|
headers: this.headers(),
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA2B;AAC3B,6CAA6D;AAC7D,+CAIuB;AACvB,uCAAyB;AACzB,2CAA+F;AAC/F,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA2B;AAC3B,6CAA6D;AAC7D,+CAIuB;AACvB,uCAAyB;AACzB,2CAA+F;AAC/F,6CAA2C;AAC3C,sDAAyB;AACzB,yCAAsD;AACtD,iDAAiD;AAEjD,2DAA0E;AAAjE,oHAAA,cAAc,OAAA;AACvB,mDAA8C;AAArC,qGAAA,GAAG,OAAA;AAAE,uGAAA,KAAK,OAAA;AAEnB,MAAM,QAAQ,GAAG,gBAAgB,CAAC;AA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AC;4BACF,EAAE,CAAC,IAAI,CACL,YAAY,CAAC,kCAAoB,EAAE;gCACjC,OAAO,EAAE,YAAY,CAAC,OAAO;gCAC7B,OAAO;6BACR,CAAC,CACH,CAAC;wBACJ,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC;oBACtD,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gBAC5C,CAAC;qBAAM,CAAC;oBACN,gDAAgD;oBAChD,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gBACpE,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,OAAO,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;QACjC,CAAC;;;;AAtQU,wBAAM;AAyQnB,MAAM,eAAe;IACX,EAAE,CAAY;IACtB,YAAY,EAAa;QACvB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;IAED,KAAK;QACH,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SDK_VERSION = "0.7.0";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,OAAO,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import type { Logger } from "
|
|
1
|
+
import * as guava from "@guava-ai/guava-sdk";
|
|
2
|
+
import { IntentRecognizer } from "@guava-ai/guava-sdk/helpers/openai";
|
|
3
|
+
import type { Logger } from "@guava-ai/guava-sdk";
|
|
4
4
|
|
|
5
5
|
interface Customer {
|
|
6
6
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as guava from "
|
|
2
|
-
import { DocumentQA } from "
|
|
3
|
-
import { PROPERTY_INSURANCE_POLICY } from "
|
|
1
|
+
import * as guava from "@guava-ai/guava-sdk";
|
|
2
|
+
import { DocumentQA } from "@guava-ai/guava-sdk/helpers/openai";
|
|
3
|
+
import { PROPERTY_INSURANCE_POLICY } from "@guava-ai/guava-sdk/example-data";
|
|
4
4
|
|
|
5
5
|
class InsuranceCallController extends guava.CallController {
|
|
6
6
|
private documentQA: DocumentQA;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as guava from "
|
|
2
|
-
import { DatetimeFilter } from "
|
|
3
|
-
import { mockAppointmentsForFuture } from "
|
|
1
|
+
import * as guava from "@guava-ai/guava-sdk";
|
|
2
|
+
import { DatetimeFilter } from "@guava-ai/guava-sdk/helpers/openai";
|
|
3
|
+
import { mockAppointmentsForFuture } from "@guava-ai/guava-sdk/example-data";
|
|
4
4
|
|
|
5
5
|
class SchedulingController extends guava.CallController {
|
|
6
6
|
private readonly patientName: string;
|
|
@@ -17,7 +17,7 @@ class SchedulingController extends guava.CallController {
|
|
|
17
17
|
sourceList: mockAppointmentsForFuture(),
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
// Use setPersona to set basic information about the agent, as well as
|
|
20
|
+
// Use setPersona to set basic information about the agent, as well as its high-level purpose.
|
|
21
21
|
this.setPersona({
|
|
22
22
|
organizationName: "Bright Smile Dental",
|
|
23
23
|
agentName: "Grace",
|
|
@@ -32,32 +32,32 @@ class SchedulingController extends guava.CallController {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
private scheduleRecipient() {
|
|
35
|
-
//
|
|
36
|
-
//
|
|
35
|
+
// We have now confirmed that we are talking to the patient.
|
|
36
|
+
// Set the Agent's current task to collect the desired appointment time.
|
|
37
37
|
this.setTask(
|
|
38
38
|
{
|
|
39
39
|
// The check list is an ordered list of items for the agent to go through.
|
|
40
|
+
// It can include short prompts as well as Fields to capture structured information.
|
|
40
41
|
checklist: [
|
|
41
|
-
|
|
42
|
-
guava.Say("Let me look to see what appointment times we have available."),
|
|
42
|
+
"tell them that it's been a while since their regular cleaning with Dr. Teeth, and ask if they would like to schedule an appointment now.",
|
|
43
43
|
// We have one field to collect, which is the appointment_time.
|
|
44
44
|
guava.Field({
|
|
45
45
|
key: "appointment_time",
|
|
46
46
|
fieldType: "calendar_slot",
|
|
47
47
|
description: "Find a time that works for the caller",
|
|
48
48
|
|
|
49
|
-
//
|
|
50
|
-
// with a
|
|
51
|
-
//
|
|
52
|
-
// or provides a new query.
|
|
49
|
+
// The choiceGenerator will be called when negotiating a calendar slot.
|
|
50
|
+
// We respond with a list of datetime options based on the user's
|
|
51
|
+
// criteria, which is summarized in the query string.
|
|
53
52
|
choiceGenerator: async (query: string) => {
|
|
54
|
-
//
|
|
53
|
+
// Query will have some natural language preferences like "early morning" or
|
|
54
|
+
// "next week". The dateTime filter queries our calendar for matching slots.
|
|
55
55
|
const result = await this.datetimeFilter.filter(query, { maxResults: 3 });
|
|
56
|
-
this.logger.info("
|
|
56
|
+
this.logger.info("Appointment slot matches: %s", JSON.stringify(result));
|
|
57
57
|
return result;
|
|
58
58
|
},
|
|
59
59
|
}),
|
|
60
|
-
|
|
60
|
+
"tell them their appointment has been confirmed and answer any questions before ending the call.",
|
|
61
61
|
],
|
|
62
62
|
},
|
|
63
63
|
() => this.hangup("Thank them for their time and hang up the call."),
|
package/examples/thai-palace.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as guava from "
|
|
2
|
-
import { getConsoleLogger, type Logger } from "
|
|
3
|
-
import { IntentRecognizer } from "
|
|
1
|
+
import * as guava from "@guava-ai/guava-sdk";
|
|
2
|
+
import { getConsoleLogger, type Logger } from "@guava-ai/guava-sdk";
|
|
3
|
+
import { IntentRecognizer } from "@guava-ai/guava-sdk/helpers/openai";
|
|
4
4
|
|
|
5
5
|
class ThaiPalaceCallController extends guava.CallController {
|
|
6
6
|
private choices = ["restaurant waitlist", "anything else"] as const;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@guava-ai/guava-sdk",
|
|
3
3
|
"description": "The official TypeScript SDK for building Guava voice agents.",
|
|
4
4
|
"homepage": "https://docs.goguava.ai/typescript-sdk/",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.8.0",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"types": "dist/src/index.d.ts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@biomejs/biome": "2.
|
|
24
|
+
"@biomejs/biome": "2.4.9",
|
|
25
25
|
"@types/node": "^25.0.7",
|
|
26
26
|
"@types/ws": "^8.18.1",
|
|
27
27
|
"tsx": "^4.21.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"format": "biome format --write ./src ./examples",
|
|
44
44
|
"check": "npm run typecheck && npm audit && npm run lint && npm run check-format",
|
|
45
45
|
"clean": "rm -rf ./dist",
|
|
46
|
-
"build": "tsc",
|
|
46
|
+
"build": "tsx scripts/update-version.ts && tsc && chmod +x ./dist/bin/example-runner.js",
|
|
47
47
|
"prepublishOnly": "npm run clean && npm run build"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
package/src/helpers/openai.ts
CHANGED
|
@@ -3,11 +3,12 @@ import { zodTextFormat } from "openai/helpers/zod";
|
|
|
3
3
|
import { type Logger, getDefaultLogger } from "../logging.ts";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
import { telemetryClient } from "../telemetry.ts";
|
|
6
|
+
import { getBaseUrl } from "../utils.ts";
|
|
6
7
|
|
|
7
8
|
// from beta.py
|
|
8
9
|
// TODO: Remove after beta
|
|
9
10
|
function beta_create_openai_client(logger: Logger) {
|
|
10
|
-
const baseUrl =
|
|
11
|
+
const baseUrl = getBaseUrl();
|
|
11
12
|
// to get it working with OpenAI TS/JS client
|
|
12
13
|
const basedUrl = new URL("openai/v1/", baseUrl);
|
|
13
14
|
logger.info(`Creating beta OpenAI client`);
|
package/src/index.ts
CHANGED
|
@@ -7,13 +7,14 @@ import {
|
|
|
7
7
|
} from "./commands.ts";
|
|
8
8
|
import * as z from "zod";
|
|
9
9
|
import { ErrorEvent, SessionStartedEvent, decodeEvent, InboundTunnelEvent } from "./events.ts";
|
|
10
|
-
import
|
|
10
|
+
import { SDK_VERSION } from "./version.ts";
|
|
11
11
|
import os from "node:os";
|
|
12
12
|
import { getBaseUrl, fetchOrThrow } from "./utils.ts";
|
|
13
13
|
import { telemetryClient } from "./telemetry.ts";
|
|
14
14
|
import type { CallController } from "./call-controller.ts";
|
|
15
15
|
export { CallController, type TaskObjective } from "./call-controller.ts";
|
|
16
16
|
export { Say, Field } from "./action_item.ts";
|
|
17
|
+
export { Logger, getConsoleLogger } from "./logging.ts";
|
|
17
18
|
|
|
18
19
|
const SDK_NAME = "typescript-sdk";
|
|
19
20
|
|
|
@@ -101,16 +102,16 @@ export class Client {
|
|
|
101
102
|
"x-guava-runtime": process.release.name,
|
|
102
103
|
"x-guava-runtime-version": process.version,
|
|
103
104
|
"x-guava-sdk": SDK_NAME,
|
|
104
|
-
"x-guava-sdk-version":
|
|
105
|
+
"x-guava-sdk-version": SDK_VERSION,
|
|
105
106
|
};
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
private async _checkSdkDeprecation() {
|
|
109
|
-
this._logger.debug(`Checking deprecation for SDK ${SDK_NAME}, ${
|
|
110
|
+
this._logger.debug(`Checking deprecation for SDK ${SDK_NAME}, ${SDK_VERSION}.`);
|
|
110
111
|
try {
|
|
111
112
|
const url = new URL("v1/check-sdk-deprecation", this.getHttpBase());
|
|
112
113
|
url.searchParams.set("sdk_name", SDK_NAME);
|
|
113
|
-
url.searchParams.set("sdk_version",
|
|
114
|
+
url.searchParams.set("sdk_version", SDK_VERSION);
|
|
114
115
|
const response = await fetchOrThrow(url, {
|
|
115
116
|
method: "POST",
|
|
116
117
|
headers: this.headers(),
|
package/src/utils.ts
CHANGED
package/src/version.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const SDK_VERSION = "0.7.0";
|
package/dist/package.json
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@guava-ai/guava-sdk",
|
|
3
|
-
"description": "The official TypeScript SDK for building Guava voice agents.",
|
|
4
|
-
"homepage": "https://docs.goguava.ai/typescript-sdk/",
|
|
5
|
-
"version": "0.6.0",
|
|
6
|
-
"type": "commonjs",
|
|
7
|
-
"main": "dist/src/index.js",
|
|
8
|
-
"types": "dist/src/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/src/index.d.ts",
|
|
12
|
-
"default": "./dist/src/index.js"
|
|
13
|
-
},
|
|
14
|
-
"./helpers/openai": {
|
|
15
|
-
"types": "./dist/src/helpers/openai.d.ts",
|
|
16
|
-
"default": "./dist/src/helpers/openai.js"
|
|
17
|
-
},
|
|
18
|
-
"./example-data": {
|
|
19
|
-
"types": "./dist/src/example-data.d.ts",
|
|
20
|
-
"default": "./dist/src/example-data.js"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"@biomejs/biome": "2.3.11",
|
|
25
|
-
"@types/node": "^25.0.7",
|
|
26
|
-
"@types/ws": "^8.18.1",
|
|
27
|
-
"tsx": "^4.21.0",
|
|
28
|
-
"typescript": "^5.9.3"
|
|
29
|
-
},
|
|
30
|
-
"bin": {
|
|
31
|
-
"guava-example": "./dist/bin/example-runner.js"
|
|
32
|
-
},
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"openai": "^6.16.0",
|
|
35
|
-
"ws": "^8.19.0",
|
|
36
|
-
"zod": "^4.3.5"
|
|
37
|
-
},
|
|
38
|
-
"scripts": {
|
|
39
|
-
"typecheck": "tsc --noEmit",
|
|
40
|
-
"lint": "biome lint --max-diagnostics=none",
|
|
41
|
-
"lint-fix": "biome lint --max-diagnostics=none --write",
|
|
42
|
-
"check-format": "biome format ./src ./examples",
|
|
43
|
-
"format": "biome format --write ./src ./examples",
|
|
44
|
-
"check": "npm run typecheck && npm audit && npm run lint && npm run check-format",
|
|
45
|
-
"clean": "rm -rf ./dist",
|
|
46
|
-
"build": "tsc",
|
|
47
|
-
"prepublishOnly": "npm run clean && npm run build"
|
|
48
|
-
},
|
|
49
|
-
"publishConfig": {
|
|
50
|
-
"access": "public"
|
|
51
|
-
},
|
|
52
|
-
"files": [
|
|
53
|
-
"/src",
|
|
54
|
-
"/dist",
|
|
55
|
-
"/examples",
|
|
56
|
-
"/bin"
|
|
57
|
-
]
|
|
58
|
-
}
|