@fonoster/autopilot 0.7.19 → 0.7.20

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 CHANGED
@@ -88,7 +88,7 @@ The Autopilot supports multiple language model providers. The following is a lis
88
88
 
89
89
  | Provider | Description | Supported models
90
90
  |------------|------------------------------------------------------------|------------------------------------------------------------------------------|
91
- | OpenAI | OpenAI provides various GPT models for conversational AI | `gpt-4o`, `gpt-4o-mini` |
91
+ | OpenAI | OpenAI provides various GPT models for conversational AI | `gpt-4o`, `gpt-4o-mini`, `gpt-3.5-turbo`, `gpt-4-turbo` |
92
92
  | Groq | Groq offers high-performance AI models optimized for speed | `gemm-7b-it`, `llama3-groq-70b-8192-tool-use-preview`, `llama3-1-8b-instant` |
93
93
  | Ollama | Self-hosted Ollama models | `lama3.1` |
94
94
 
@@ -6,6 +6,7 @@ declare const conversationSettingsSchema: z.ZodObject<{
6
6
  goodbyeMessage: z.ZodString;
7
7
  systemErrorMessage: z.ZodString;
8
8
  initialDtmf: z.ZodNullable<z.ZodOptional<z.ZodString>>;
9
+ maxSpeechWaitTimeout: z.ZodNumber;
9
10
  transferOptions: z.ZodNullable<z.ZodOptional<z.ZodObject<{
10
11
  phoneNumber: z.ZodString;
11
12
  message: z.ZodString;
@@ -53,6 +54,7 @@ declare const conversationSettingsSchema: z.ZodObject<{
53
54
  systemTemplate: string;
54
55
  goodbyeMessage: string;
55
56
  systemErrorMessage: string;
57
+ maxSpeechWaitTimeout: number;
56
58
  vad: {
57
59
  activationThreshold: number;
58
60
  deactivationThreshold: number;
@@ -75,6 +77,7 @@ declare const conversationSettingsSchema: z.ZodObject<{
75
77
  systemTemplate: string;
76
78
  goodbyeMessage: string;
77
79
  systemErrorMessage: string;
80
+ maxSpeechWaitTimeout: number;
78
81
  vad: {
79
82
  activationThreshold: number;
80
83
  deactivationThreshold: number;
@@ -295,6 +298,7 @@ declare const assistantSchema: z.ZodObject<{
295
298
  goodbyeMessage: z.ZodString;
296
299
  systemErrorMessage: z.ZodString;
297
300
  initialDtmf: z.ZodNullable<z.ZodOptional<z.ZodString>>;
301
+ maxSpeechWaitTimeout: z.ZodNumber;
298
302
  transferOptions: z.ZodNullable<z.ZodOptional<z.ZodObject<{
299
303
  phoneNumber: z.ZodString;
300
304
  message: z.ZodString;
@@ -342,6 +346,7 @@ declare const assistantSchema: z.ZodObject<{
342
346
  systemTemplate: string;
343
347
  goodbyeMessage: string;
344
348
  systemErrorMessage: string;
349
+ maxSpeechWaitTimeout: number;
345
350
  vad: {
346
351
  activationThreshold: number;
347
352
  deactivationThreshold: number;
@@ -364,6 +369,7 @@ declare const assistantSchema: z.ZodObject<{
364
369
  systemTemplate: string;
365
370
  goodbyeMessage: string;
366
371
  systemErrorMessage: string;
372
+ maxSpeechWaitTimeout: number;
367
373
  vad: {
368
374
  activationThreshold: number;
369
375
  deactivationThreshold: number;
@@ -583,6 +589,7 @@ declare const assistantSchema: z.ZodObject<{
583
589
  systemTemplate: string;
584
590
  goodbyeMessage: string;
585
591
  systemErrorMessage: string;
592
+ maxSpeechWaitTimeout: number;
586
593
  vad: {
587
594
  activationThreshold: number;
588
595
  deactivationThreshold: number;
@@ -640,6 +647,7 @@ declare const assistantSchema: z.ZodObject<{
640
647
  systemTemplate: string;
641
648
  goodbyeMessage: string;
642
649
  systemErrorMessage: string;
650
+ maxSpeechWaitTimeout: number;
643
651
  vad: {
644
652
  activationThreshold: number;
645
653
  deactivationThreshold: number;
@@ -28,6 +28,7 @@ const conversationSettingsSchema = zod_1.z.object({
28
28
  goodbyeMessage: zod_1.z.string(),
29
29
  systemErrorMessage: zod_1.z.string(),
30
30
  initialDtmf: zod_1.z.string().optional().nullable(),
31
+ maxSpeechWaitTimeout: zod_1.z.number(),
31
32
  transferOptions: zod_1.z
32
33
  .object({
33
34
  phoneNumber: zod_1.z.string(),
@@ -79,7 +79,7 @@ declare const machine: import("xstate").StateMachine<AutopilotContext, {
79
79
  type: "isNotSpeaking";
80
80
  params: unknown;
81
81
  };
82
- }>, "IDLE_TIMEOUT", "hangup" | "greeting" | "idle" | "waitingForUserRequest" | "transitioningToIdle" | "updatingSpeech" | "processingUserRequest", string, {
82
+ }>, "IDLE_TIMEOUT" | "MAX_SPEECH_WAIT_TIMEOUT", "hangup" | "greeting" | "idle" | "waitingForUserRequest" | "transitioningToIdle" | "updatingSpeech" | "processingUserRequest", string, {
83
83
  conversationSettings: ConversationSettings;
84
84
  languageModel: LanguageModel;
85
85
  voice: Voice;
@@ -157,6 +157,7 @@ declare const machine: import("xstate").StateMachine<AutopilotContext, {
157
157
  idleTimeout: number;
158
158
  maxIdleTimeoutCount: number;
159
159
  idleTimeoutCount: number;
160
+ maxSpeechWaitTimeout: number;
160
161
  speechResponseStartTime: number;
161
162
  speechResponseTime: number;
162
163
  isSpeaking: false;
@@ -178,6 +179,10 @@ declare const machine: import("xstate").StateMachine<AutopilotContext, {
178
179
  readonly target: "waitingForUserRequest";
179
180
  readonly description: "Event from VAD system.";
180
181
  };
182
+ readonly SPEECH_RESULT: {
183
+ readonly target: "waitingForUserRequest";
184
+ readonly description: "Event from Speech to Text provider.";
185
+ };
181
186
  };
182
187
  readonly after: {
183
188
  readonly IDLE_TIMEOUT: readonly [{
@@ -253,6 +258,11 @@ declare const machine: import("xstate").StateMachine<AutopilotContext, {
253
258
  };
254
259
  }];
255
260
  };
261
+ readonly after: {
262
+ readonly MAX_SPEECH_WAIT_TIMEOUT: {
263
+ readonly target: "processingUserRequest";
264
+ };
265
+ };
256
266
  };
257
267
  readonly processingUserRequest: {
258
268
  readonly on: {
@@ -124,6 +124,9 @@ const machine = (0, xstate_1.setup)({
124
124
  delays: {
125
125
  IDLE_TIMEOUT: ({ context }) => {
126
126
  return context.idleTimeout;
127
+ },
128
+ MAX_SPEECH_WAIT_TIMEOUT: ({ context }) => {
129
+ return context.maxSpeechWaitTimeout;
127
130
  }
128
131
  },
129
132
  actors: {
@@ -191,6 +194,7 @@ const machine = (0, xstate_1.setup)({
191
194
  idleTimeout: input.conversationSettings.idleOptions?.timeout || 10000,
192
195
  maxIdleTimeoutCount: input.conversationSettings.idleOptions?.maxTimeoutCount || 3,
193
196
  idleTimeoutCount: 0,
197
+ maxSpeechWaitTimeout: input.conversationSettings.maxSpeechWaitTimeout,
194
198
  speechResponseStartTime: 0,
195
199
  speechResponseTime: 0,
196
200
  isSpeaking: false
@@ -211,6 +215,10 @@ const machine = (0, xstate_1.setup)({
211
215
  SPEECH_START: {
212
216
  target: "waitingForUserRequest",
213
217
  description: "Event from VAD system."
218
+ },
219
+ SPEECH_RESULT: {
220
+ target: "waitingForUserRequest",
221
+ description: "Event from Speech to Text provider."
214
222
  }
215
223
  },
216
224
  after: {
@@ -303,6 +311,11 @@ const machine = (0, xstate_1.setup)({
303
311
  }
304
312
  }
305
313
  ]
314
+ },
315
+ after: {
316
+ MAX_SPEECH_WAIT_TIMEOUT: {
317
+ target: "processingUserRequest"
318
+ }
306
319
  }
307
320
  },
308
321
  processingUserRequest: {
@@ -13,6 +13,7 @@ type AutopilotContext = {
13
13
  idleTimeout: number;
14
14
  idleTimeoutCount: number;
15
15
  maxIdleTimeoutCount: number;
16
+ maxSpeechWaitTimeout: number;
16
17
  speechBuffer: string;
17
18
  speechResponseStartTime: number;
18
19
  speechResponseTime: number;
@@ -1,7 +1,9 @@
1
1
  import { BaseModelParams } from "../types";
2
2
  declare enum OpenAIModel {
3
3
  GPT_4O = "gpt-4o",
4
- GPT_4O_MINI = "gpt-4o-mini"
4
+ GPT_4O_MINI = "gpt-4o-mini",
5
+ GPT_3_5_TURBO = "gpt-3.5-turbo",
6
+ GPT_4_TURBO = "gpt-4-turbo"
5
7
  }
6
8
  type OpenAIParams = BaseModelParams & {
7
9
  model: OpenAIModel;
@@ -5,4 +5,6 @@ var OpenAIModel;
5
5
  (function (OpenAIModel) {
6
6
  OpenAIModel["GPT_4O"] = "gpt-4o";
7
7
  OpenAIModel["GPT_4O_MINI"] = "gpt-4o-mini";
8
+ OpenAIModel["GPT_3_5_TURBO"] = "gpt-3.5-turbo";
9
+ OpenAIModel["GPT_4_TURBO"] = "gpt-4-turbo";
8
10
  })(OpenAIModel || (exports.OpenAIModel = OpenAIModel = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/autopilot",
3
- "version": "0.7.19",
3
+ "version": "0.7.20",
4
4
  "description": "Voice AI for the Fonoster platform",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/fonoster#readme",
@@ -56,5 +56,5 @@
56
56
  "devDependencies": {
57
57
  "typescript": "^5.5.4"
58
58
  },
59
- "gitHead": "5250aa76f6c4b72a3b26beabe71ea7a7c227d7c1"
59
+ "gitHead": "bde17656cad787fd22127beaa5d8617e38be2eb6"
60
60
  }