@fonoster/autopilot 0.8.22 → 0.8.23

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.
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { LANGUAGE_MODEL_PROVIDER } from "../types";
3
3
  declare const conversationSettingsSchema: z.ZodObject<{
4
- firstMessage: z.ZodString;
4
+ firstMessage: z.ZodOptional<z.ZodString>;
5
5
  systemTemplate: z.ZodString;
6
6
  goodbyeMessage: z.ZodString;
7
7
  systemErrorMessage: z.ZodString;
@@ -50,7 +50,6 @@ declare const conversationSettingsSchema: z.ZodObject<{
50
50
  pathToModel?: string | undefined;
51
51
  }>;
52
52
  }, "strip", z.ZodTypeAny, {
53
- firstMessage: string;
54
53
  systemTemplate: string;
55
54
  goodbyeMessage: string;
56
55
  systemErrorMessage: string;
@@ -61,6 +60,7 @@ declare const conversationSettingsSchema: z.ZodObject<{
61
60
  debounceFrames: number;
62
61
  pathToModel?: string | undefined;
63
62
  };
63
+ firstMessage?: string | undefined;
64
64
  initialDtmf?: string | undefined;
65
65
  transferOptions?: {
66
66
  message: string;
@@ -73,7 +73,6 @@ declare const conversationSettingsSchema: z.ZodObject<{
73
73
  maxTimeoutCount: number;
74
74
  } | undefined;
75
75
  }, {
76
- firstMessage: string;
77
76
  systemTemplate: string;
78
77
  goodbyeMessage: string;
79
78
  systemErrorMessage: string;
@@ -84,6 +83,7 @@ declare const conversationSettingsSchema: z.ZodObject<{
84
83
  debounceFrames: number;
85
84
  pathToModel?: string | undefined;
86
85
  };
86
+ firstMessage?: string | undefined;
87
87
  initialDtmf?: string | undefined;
88
88
  transferOptions?: {
89
89
  message: string;
@@ -293,7 +293,7 @@ declare const languageModelConfigSchema: z.ZodObject<{
293
293
  }>;
294
294
  declare const assistantSchema: z.ZodObject<{
295
295
  conversationSettings: z.ZodObject<{
296
- firstMessage: z.ZodString;
296
+ firstMessage: z.ZodOptional<z.ZodString>;
297
297
  systemTemplate: z.ZodString;
298
298
  goodbyeMessage: z.ZodString;
299
299
  systemErrorMessage: z.ZodString;
@@ -342,7 +342,6 @@ declare const assistantSchema: z.ZodObject<{
342
342
  pathToModel?: string | undefined;
343
343
  }>;
344
344
  }, "strip", z.ZodTypeAny, {
345
- firstMessage: string;
346
345
  systemTemplate: string;
347
346
  goodbyeMessage: string;
348
347
  systemErrorMessage: string;
@@ -353,6 +352,7 @@ declare const assistantSchema: z.ZodObject<{
353
352
  debounceFrames: number;
354
353
  pathToModel?: string | undefined;
355
354
  };
355
+ firstMessage?: string | undefined;
356
356
  initialDtmf?: string | undefined;
357
357
  transferOptions?: {
358
358
  message: string;
@@ -365,7 +365,6 @@ declare const assistantSchema: z.ZodObject<{
365
365
  maxTimeoutCount: number;
366
366
  } | undefined;
367
367
  }, {
368
- firstMessage: string;
369
368
  systemTemplate: string;
370
369
  goodbyeMessage: string;
371
370
  systemErrorMessage: string;
@@ -376,6 +375,7 @@ declare const assistantSchema: z.ZodObject<{
376
375
  debounceFrames: number;
377
376
  pathToModel?: string | undefined;
378
377
  };
378
+ firstMessage?: string | undefined;
379
379
  initialDtmf?: string | undefined;
380
380
  transferOptions?: {
381
381
  message: string;
@@ -585,7 +585,6 @@ declare const assistantSchema: z.ZodObject<{
585
585
  }>;
586
586
  }, "strip", z.ZodTypeAny, {
587
587
  conversationSettings: {
588
- firstMessage: string;
589
588
  systemTemplate: string;
590
589
  goodbyeMessage: string;
591
590
  systemErrorMessage: string;
@@ -596,6 +595,7 @@ declare const assistantSchema: z.ZodObject<{
596
595
  debounceFrames: number;
597
596
  pathToModel?: string | undefined;
598
597
  };
598
+ firstMessage?: string | undefined;
599
599
  initialDtmf?: string | undefined;
600
600
  transferOptions?: {
601
601
  message: string;
@@ -643,7 +643,6 @@ declare const assistantSchema: z.ZodObject<{
643
643
  };
644
644
  }, {
645
645
  conversationSettings: {
646
- firstMessage: string;
647
646
  systemTemplate: string;
648
647
  goodbyeMessage: string;
649
648
  systemErrorMessage: string;
@@ -654,6 +653,7 @@ declare const assistantSchema: z.ZodObject<{
654
653
  debounceFrames: number;
655
654
  pathToModel?: string | undefined;
656
655
  };
656
+ firstMessage?: string | undefined;
657
657
  initialDtmf?: string | undefined;
658
658
  transferOptions?: {
659
659
  message: string;
@@ -24,7 +24,7 @@ const zod_1 = require("zod");
24
24
  const ToolSchema_1 = require("../tools/ToolSchema");
25
25
  const types_1 = require("../types");
26
26
  const conversationSettingsSchema = zod_1.z.object({
27
- firstMessage: zod_1.z.string(),
27
+ firstMessage: zod_1.z.string().optional(),
28
28
  systemTemplate: zod_1.z.string(),
29
29
  goodbyeMessage: zod_1.z.string(),
30
30
  systemErrorMessage: zod_1.z.string(),
@@ -148,7 +148,7 @@ declare const machine: import("xstate").StateMachine<AutopilotContext, {
148
148
  voice: Voice;
149
149
  languageModel: LanguageModel;
150
150
  speechBuffer: string;
151
- firstMessage: string;
151
+ firstMessage: string | undefined;
152
152
  goodbyeMessage: string;
153
153
  transferMessage: string | undefined;
154
154
  transferPhoneNumber: string | undefined;
@@ -35,7 +35,9 @@ const machine = (0, xstate_1.setup)({
35
35
  firstMessage: context.firstMessage
36
36
  });
37
37
  await context.voice.answer();
38
- await context.voice.say(context.firstMessage);
38
+ if (context.firstMessage) {
39
+ await context.voice.say(context.firstMessage);
40
+ }
39
41
  },
40
42
  goodbye: async ({ context }) => {
41
43
  logger.verbose("called goodbye action", {
@@ -4,7 +4,7 @@ type AutopilotContext = {
4
4
  sessionRef: string;
5
5
  languageModel: LanguageModel;
6
6
  voice: Voice;
7
- firstMessage: string;
7
+ firstMessage?: string;
8
8
  goodbyeMessage: string;
9
9
  transferMessage?: string;
10
10
  transferPhoneNumber?: string;
@@ -1,10 +1,10 @@
1
1
  import { InvocationResult, LanguageModel, LanguageModelParams, TelephonyContext } from "./types";
2
2
  import { Voice } from "../voice";
3
3
  declare abstract class AbstractLanguageModel implements LanguageModel {
4
- private chain;
5
- private chatHistory;
6
- private toolsCatalog;
7
- private voice;
4
+ private readonly chain;
5
+ private readonly chatHistory;
6
+ private readonly toolsCatalog;
7
+ private readonly voice;
8
8
  constructor(params: LanguageModelParams, voice: Voice, telephonyContext: TelephonyContext);
9
9
  invoke(text: string): Promise<InvocationResult>;
10
10
  }
@@ -1,7 +1,7 @@
1
1
  import { ChatPromptTemplate } from "@langchain/core/prompts";
2
2
  import { TelephonyContext } from "./types";
3
3
  export declare function createPromptTemplate(params: {
4
- firstMessage: string;
4
+ firstMessage?: string;
5
5
  systemTemplate: string;
6
6
  telephonyContext: TelephonyContext;
7
7
  }): ChatPromptTemplate<any, any>;
@@ -6,7 +6,7 @@ type LanguageModel = {
6
6
  invoke: (text: string) => Promise<InvocationResult>;
7
7
  };
8
8
  type BaseModelParams = {
9
- firstMessage: string;
9
+ firstMessage?: string;
10
10
  systemTemplate: string;
11
11
  knowledgeBase: KnowledgeBase;
12
12
  tools: Tool[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/autopilot",
3
- "version": "0.8.22",
3
+ "version": "0.8.23",
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",
@@ -54,5 +54,5 @@
54
54
  "devDependencies": {
55
55
  "typescript": "^5.5.4"
56
56
  },
57
- "gitHead": "d91a20ab24877c0c854f21395473b8332d4a6f02"
57
+ "gitHead": "627b01906d1dd147c70d4beacd1c76ad22f3d8f4"
58
58
  }