@fonoster/autopilot 0.9.43 → 0.9.47

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.
@@ -26,6 +26,9 @@ const greetUser = async ({ context }) => {
26
26
  firstMessage: context.firstMessage
27
27
  });
28
28
  await context.voice.answer();
29
+ if (context.initialDtmf) {
30
+ await context.voice.playDtmf(context.initialDtmf);
31
+ }
29
32
  if (context.firstMessage) {
30
33
  await context.voice.say(context.firstMessage);
31
34
  }
@@ -44,5 +44,6 @@ declare const context: ({ input }: {
44
44
  isSpeaking: boolean;
45
45
  sessionStartTime: number;
46
46
  maxSessionDuration: number;
47
+ initialDtmf: string;
47
48
  };
48
49
  export { context };
@@ -19,6 +19,7 @@ const context = ({ input }) => ({
19
19
  maxSpeechWaitTimeout: input.conversationSettings.maxSpeechWaitTimeout,
20
20
  isSpeaking: false,
21
21
  sessionStartTime: Date.now(),
22
- maxSessionDuration: input.conversationSettings.maxSessionDuration
22
+ maxSessionDuration: input.conversationSettings.maxSessionDuration,
23
+ initialDtmf: input.conversationSettings.initialDtmf
23
24
  });
24
25
  exports.context = context;
@@ -101,6 +101,7 @@ declare const machine: import("xstate").StateMachine<any, import("./types").Auto
101
101
  isSpeaking: boolean;
102
102
  sessionStartTime: number;
103
103
  maxSessionDuration: number;
104
+ initialDtmf: string;
104
105
  };
105
106
  readonly id: "fnAI";
106
107
  readonly initial: "greeting";
@@ -37,6 +37,7 @@ type AutopilotContext = {
37
37
  speechResponseTime: number;
38
38
  isSpeaking: boolean;
39
39
  knowledgeBaseSourceUrl?: string;
40
+ initialDtmf?: string;
40
41
  };
41
42
  type AutopilotEvents = {
42
43
  type: "SPEECH_START";
@@ -1,6 +1,26 @@
1
- import { LanguageModelProvider } from "../types";
1
+ /**
2
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ import { LanguageModelProvider } from "@fonoster/common";
2
20
  import { Voice } from "../voice";
3
21
  import { AbstractLanguageModel } from "./AbstractLanguageModel";
22
+ import { AnthropicParams } from "./anthropic";
23
+ import { GoogleParams } from "./google";
4
24
  import { GroqParams } from "./groq";
5
25
  import { OllamaParams } from "./ollama";
6
26
  import { OpenAIParams } from "./openai";
@@ -10,6 +30,8 @@ type LanguageModelConfigMap = {
10
30
  [LanguageModelProvider.OPENAI]: OpenAIParams;
11
31
  [LanguageModelProvider.GROQ]: GroqParams;
12
32
  [LanguageModelProvider.OLLAMA]: OllamaParams;
33
+ [LanguageModelProvider.GOOGLE]: GoogleParams;
34
+ [LanguageModelProvider.ANTHROPIC]: AnthropicParams;
13
35
  };
14
36
  declare class LanguageModelFactory {
15
37
  private static readonly languageModels;
@@ -19,8 +19,10 @@ exports.LanguageModelFactory = void 0;
19
19
  * See the License for the specific language governing permissions and
20
20
  * limitations under the License.
21
21
  */
22
+ const common_1 = require("@fonoster/common");
22
23
  const logger_1 = require("@fonoster/logger");
23
- const types_1 = require("../types");
24
+ const anthropic_1 = require("./anthropic");
25
+ const google_1 = require("./google");
24
26
  const groq_1 = require("./groq");
25
27
  const ollama_1 = require("./ollama");
26
28
  const openai_1 = require("./openai");
@@ -44,3 +46,5 @@ LanguageModelFactory.languageModels = new Map();
44
46
  LanguageModelFactory.registerLanguageModel(openai_1.LANGUAGE_MODEL_NAME, openai_1.OpenAI);
45
47
  LanguageModelFactory.registerLanguageModel(groq_1.LANGUAGE_MODEL_NAME, groq_1.Groq);
46
48
  LanguageModelFactory.registerLanguageModel(ollama_1.LANGUAGE_MODEL_NAME, ollama_1.Ollama);
49
+ LanguageModelFactory.registerLanguageModel(google_1.LANGUAGE_MODEL_NAME, google_1.Google);
50
+ LanguageModelFactory.registerLanguageModel(anthropic_1.LANGUAGE_MODEL_NAME, anthropic_1.Anthropic);
@@ -0,0 +1,9 @@
1
+ import { Voice } from "../../voice";
2
+ import { AbstractLanguageModel } from "../AbstractLanguageModel";
3
+ import { TelephonyContext } from "../types";
4
+ import { AnthropicParams } from "./types";
5
+ declare const LANGUAGE_MODEL_NAME = "llm.anthropic";
6
+ declare class Anthropic extends AbstractLanguageModel {
7
+ constructor(params: AnthropicParams, voice: Voice, telephonyContext: TelephonyContext);
8
+ }
9
+ export { Anthropic, LANGUAGE_MODEL_NAME };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LANGUAGE_MODEL_NAME = exports.Anthropic = void 0;
4
+ /**
5
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
+ * http://github.com/fonoster/fonoster
7
+ *
8
+ * This file is part of Fonoster
9
+ *
10
+ * Licensed under the MIT License (the "License");
11
+ * you may not use this file except in compliance with
12
+ * the License. You may obtain a copy of the License at
13
+ *
14
+ * https://opensource.org/licenses/MIT
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ const anthropic_1 = require("@langchain/anthropic");
23
+ const tools_1 = require("../../tools");
24
+ const AbstractLanguageModel_1 = require("../AbstractLanguageModel");
25
+ const LANGUAGE_MODEL_NAME = "llm.anthropic";
26
+ exports.LANGUAGE_MODEL_NAME = LANGUAGE_MODEL_NAME;
27
+ class Anthropic extends AbstractLanguageModel_1.AbstractLanguageModel {
28
+ constructor(params, voice, telephonyContext) {
29
+ const model = new anthropic_1.ChatAnthropic({
30
+ ...params
31
+ }).bind({
32
+ tools: params.tools.map(tools_1.convertToolToOpenAITool)
33
+ });
34
+ super({
35
+ ...params,
36
+ model
37
+ }, voice, telephonyContext);
38
+ }
39
+ }
40
+ exports.Anthropic = Anthropic;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ export * from "./Anthropic";
20
+ export * from "./types";
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
19
+ * http://github.com/fonoster/fonoster
20
+ *
21
+ * This file is part of Fonoster
22
+ *
23
+ * Licensed under the MIT License (the "License");
24
+ * you may not use this file except in compliance with
25
+ * the License. You may obtain a copy of the License at
26
+ *
27
+ * https://opensource.org/licenses/MIT
28
+ *
29
+ * Unless required by applicable law or agreed to in writing, software
30
+ * distributed under the License is distributed on an "AS IS" BASIS,
31
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32
+ * See the License for the specific language governing permissions and
33
+ * limitations under the License.
34
+ */
35
+ __exportStar(require("./Anthropic"), exports);
36
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ import { BaseModelParams } from "../types";
20
+ declare enum AnthropicModel {
21
+ CLAUDE_3_5_SONNET = "claude-3-5-sonnet-latest",
22
+ CLAUDE_3_5_HAIKU = "claude-3-5-haiku-latest"
23
+ }
24
+ type AnthropicParams = BaseModelParams & {
25
+ model: AnthropicModel;
26
+ apiKey: string;
27
+ maxTokens: number;
28
+ temperature: number;
29
+ };
30
+ export { AnthropicModel, AnthropicParams };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AnthropicModel = void 0;
4
+ var AnthropicModel;
5
+ (function (AnthropicModel) {
6
+ AnthropicModel["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-latest";
7
+ AnthropicModel["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-latest";
8
+ })(AnthropicModel || (exports.AnthropicModel = AnthropicModel = {}));
@@ -23,14 +23,21 @@ const prompts_1 = require("@langchain/core/prompts");
23
23
  function createPromptTemplate(params) {
24
24
  const { firstMessage, systemPrompt, telephonyContext } = params;
25
25
  return prompts_1.ChatPromptTemplate.fromMessages([
26
+ prompts_1.SystemMessagePromptTemplate.fromTemplate(`${systemPrompt}
27
+
28
+ [First Message from System]
29
+ ${firstMessage}
30
+
31
+ [Context]
32
+ {context}
33
+
34
+ [Call Information]
35
+ callReceivedAt: ${new Date().toISOString()}
36
+ ingressNumber: ${telephonyContext.ingressNumber}
37
+ callerNumber: ${telephonyContext.callerNumber}
38
+ callDirection: ${telephonyContext.callDirection}
39
+ `),
26
40
  new prompts_1.MessagesPlaceholder("history"),
27
- prompts_1.SystemMessagePromptTemplate.fromTemplate(`firstMessage: ${firstMessage}`),
28
- prompts_1.SystemMessagePromptTemplate.fromTemplate(systemPrompt),
29
- prompts_1.SystemMessagePromptTemplate.fromTemplate("{context}"),
30
- prompts_1.SystemMessagePromptTemplate.fromTemplate(`callReceivedAt:${new Date().toISOString()}
31
- ingressNumber:${telephonyContext.ingressNumber}
32
- callerNumber:${telephonyContext.callerNumber}
33
- callDirection:${telephonyContext.callDirection}`),
34
41
  prompts_1.HumanMessagePromptTemplate.fromTemplate("{input}")
35
42
  ]);
36
43
  }
@@ -0,0 +1,9 @@
1
+ import { Voice } from "../../voice";
2
+ import { AbstractLanguageModel } from "../AbstractLanguageModel";
3
+ import { TelephonyContext } from "../types";
4
+ import { GoogleParams } from "./types";
5
+ declare const LANGUAGE_MODEL_NAME = "llm.google";
6
+ declare class Google extends AbstractLanguageModel {
7
+ constructor(params: GoogleParams, voice: Voice, telephonyContext: TelephonyContext);
8
+ }
9
+ export { Google, LANGUAGE_MODEL_NAME };
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LANGUAGE_MODEL_NAME = exports.Google = void 0;
4
+ /**
5
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
+ * http://github.com/fonoster/fonoster
7
+ *
8
+ * This file is part of Fonoster
9
+ *
10
+ * Licensed under the MIT License (the "License");
11
+ * you may not use this file except in compliance with
12
+ * the License. You may obtain a copy of the License at
13
+ *
14
+ * https://opensource.org/licenses/MIT
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ // import { BaseChatModel } from "@langchain/core/language_models/chat_models";
23
+ const google_genai_1 = require("@langchain/google-genai");
24
+ const AbstractLanguageModel_1 = require("../AbstractLanguageModel");
25
+ const LANGUAGE_MODEL_NAME = "llm.google";
26
+ exports.LANGUAGE_MODEL_NAME = LANGUAGE_MODEL_NAME;
27
+ class Google extends AbstractLanguageModel_1.AbstractLanguageModel {
28
+ constructor(params, voice, telephonyContext) {
29
+ const model = new google_genai_1.ChatGoogleGenerativeAI({
30
+ ...params
31
+ });
32
+ // TODO: Add tools to the model
33
+ // const model = new ChatGoogleGenerativeAI({
34
+ // ...params
35
+ // }).bind({
36
+ // tools: params.tools.map(convertToolToOpenAITool)
37
+ // }) as unknown as BaseChatModel;
38
+ super({
39
+ ...params,
40
+ model
41
+ }, voice, telephonyContext);
42
+ }
43
+ }
44
+ exports.Google = Google;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ export * from "./Google";
20
+ export * from "./types";
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
19
+ * http://github.com/fonoster/fonoster
20
+ *
21
+ * This file is part of Fonoster
22
+ *
23
+ * Licensed under the MIT License (the "License");
24
+ * you may not use this file except in compliance with
25
+ * the License. You may obtain a copy of the License at
26
+ *
27
+ * https://opensource.org/licenses/MIT
28
+ *
29
+ * Unless required by applicable law or agreed to in writing, software
30
+ * distributed under the License is distributed on an "AS IS" BASIS,
31
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32
+ * See the License for the specific language governing permissions and
33
+ * limitations under the License.
34
+ */
35
+ __exportStar(require("./Google"), exports);
36
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ import { BaseModelParams } from "../types";
20
+ declare enum GoogleModel {
21
+ GEMINI_2_0_FLASH = "gemini-2.0-flash",
22
+ GEMINI_2_0_FLASH_LITE = "gemini-2.0-flash-lite",
23
+ GEMINI_2_0_PRO_EXP_02_05 = "gemini-2.0-pro-exp-02-05"
24
+ }
25
+ type GoogleParams = BaseModelParams & {
26
+ model: GoogleModel;
27
+ apiKey: string;
28
+ maxTokens: number;
29
+ temperature: number;
30
+ };
31
+ export { GoogleModel, GoogleParams };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GoogleModel = void 0;
4
+ var GoogleModel;
5
+ (function (GoogleModel) {
6
+ GoogleModel["GEMINI_2_0_FLASH"] = "gemini-2.0-flash";
7
+ GoogleModel["GEMINI_2_0_FLASH_LITE"] = "gemini-2.0-flash-lite";
8
+ GoogleModel["GEMINI_2_0_PRO_EXP_02_05"] = "gemini-2.0-pro-exp-02-05";
9
+ })(GoogleModel || (exports.GoogleModel = GoogleModel = {}));
@@ -18,8 +18,8 @@
18
18
  */
19
19
  import { BaseModelParams } from "../types";
20
20
  declare enum GroqModel {
21
- LLAMA3_1_8B_INSTANT = "llama-3.1-8b-instant",
22
- LLAMA3_3_3_70B_SPECDEC = "llama-3.3-70b-specdec"
21
+ LLAMA3_3_3_70B_SPECDEC = "llama-3.3-70b-specdec",
22
+ LLAMA3_3_3_70B_VERSATILE = "llama-3.3-70b-versatile"
23
23
  }
24
24
  type GroqParams = BaseModelParams & {
25
25
  model: GroqModel;
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GroqModel = void 0;
4
4
  var GroqModel;
5
5
  (function (GroqModel) {
6
- GroqModel["LLAMA3_1_8B_INSTANT"] = "llama-3.1-8b-instant";
7
6
  GroqModel["LLAMA3_3_3_70B_SPECDEC"] = "llama-3.3-70b-specdec";
7
+ GroqModel["LLAMA3_3_3_70B_VERSATILE"] = "llama-3.3-70b-versatile";
8
8
  })(GroqModel || (exports.GroqModel = GroqModel = {}));
package/dist/types.d.ts CHANGED
@@ -20,11 +20,6 @@ import { Application } from "@fonoster/types";
20
20
  import { AssistantConfig, ConversationSettings } from "./assistants";
21
21
  import { LanguageModel } from "./models";
22
22
  import { Voice } from "./voice";
23
- declare enum LanguageModelProvider {
24
- OPENAI = "openai",
25
- GROQ = "groq",
26
- OLLAMA = "ollama"
27
- }
28
23
  declare enum ConversationProvider {
29
24
  FILE = "file",
30
25
  API = "api"
@@ -40,4 +35,4 @@ type AutopilotApplication = Application & {
40
35
  config: AssistantConfig;
41
36
  };
42
37
  };
43
- export { AutopilotParams, LanguageModelProvider, ConversationProvider, AutopilotApplication };
38
+ export { AutopilotParams, ConversationProvider, AutopilotApplication };
package/dist/types.js CHANGED
@@ -1,12 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConversationProvider = exports.LanguageModelProvider = void 0;
4
- var LanguageModelProvider;
5
- (function (LanguageModelProvider) {
6
- LanguageModelProvider["OPENAI"] = "openai";
7
- LanguageModelProvider["GROQ"] = "groq";
8
- LanguageModelProvider["OLLAMA"] = "ollama";
9
- })(LanguageModelProvider || (exports.LanguageModelProvider = LanguageModelProvider = {}));
3
+ exports.ConversationProvider = void 0;
10
4
  var ConversationProvider;
11
5
  (function (ConversationProvider) {
12
6
  ConversationProvider["FILE"] = "file";
@@ -19,6 +19,7 @@ declare class VoiceImpl implements Voice {
19
19
  answer(): Promise<void>;
20
20
  hangup(): Promise<void>;
21
21
  say(text: string): Promise<void>;
22
+ playDtmf(dtmf: string): Promise<void>;
22
23
  sgather(): Promise<{
23
24
  stop: () => Promise<void>;
24
25
  onData: (cb: (payload: {
@@ -36,6 +36,9 @@ class VoiceImpl {
36
36
  async say(text) {
37
37
  await this.voice.say(text, { playbackRef: this.playbackRef });
38
38
  }
39
+ async playDtmf(dtmf) {
40
+ await this.voice.playDtmf(dtmf);
41
+ }
39
42
  async sgather() {
40
43
  const stream = await this.voice.sgather({
41
44
  source: common_1.StreamGatherSource.SPEECH
@@ -36,6 +36,7 @@ type Voice = {
36
36
  answer: () => Promise<void>;
37
37
  hangup: () => Promise<void>;
38
38
  say: (text: string) => Promise<void>;
39
+ playDtmf: (dtmf: string) => Promise<void>;
39
40
  sgather: () => Promise<GatherStream>;
40
41
  transfer: (destination: string, options?: TransferOptions) => Promise<void>;
41
42
  stream: () => Promise<Stream>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/autopilot",
3
- "version": "0.9.43",
3
+ "version": "0.9.47",
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",
@@ -33,13 +33,15 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@aws-sdk/client-s3": "^3.712.0",
36
- "@fonoster/common": "^0.9.42",
37
- "@fonoster/logger": "^0.9.42",
38
- "@fonoster/sdk": "^0.9.42",
39
- "@fonoster/types": "^0.9.42",
40
- "@fonoster/voice": "^0.9.42",
36
+ "@fonoster/common": "^0.9.47",
37
+ "@fonoster/logger": "^0.9.46",
38
+ "@fonoster/sdk": "^0.9.47",
39
+ "@fonoster/types": "^0.9.46",
40
+ "@fonoster/voice": "^0.9.47",
41
+ "@langchain/anthropic": "^0.3.15",
41
42
  "@langchain/community": "^0.3.32",
42
43
  "@langchain/core": "^0.3.40",
44
+ "@langchain/google-genai": "^0.1.11",
43
45
  "@langchain/groq": "^0.1.3",
44
46
  "@langchain/ollama": "^0.1.6",
45
47
  "@langchain/openai": "^0.4.4",
@@ -56,5 +58,5 @@
56
58
  "xstate": "^5.17.3",
57
59
  "zod": "^3.23.8"
58
60
  },
59
- "gitHead": "7fa2745908c3ced8a5401a48b26cf26c8fc09c2c"
61
+ "gitHead": "fa7a06ca67fb6ed718396d7381927c80c49d8da2"
60
62
  }