@fonoster/autopilot 0.9.6 → 0.9.8

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/dist/envs.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export declare const SKIP_IDENTITY: boolean;
2
1
  export declare const AWS_S3_ACCESS_KEY_ID: string | undefined;
3
2
  export declare const AWS_S3_ENDPOINT: string | undefined;
4
3
  export declare const AWS_S3_REGION: string;
@@ -12,3 +11,5 @@ export declare const CONVERSATION_PROVIDER: string;
12
11
  export declare const CONVERSATION_PROVIDER_FILE: string;
13
12
  export declare const APISERVER_ENDPOINT: string;
14
13
  export declare const INTEGRATIONS_FILE: string;
14
+ export declare const OPENAI_API_KEY: string | undefined;
15
+ export declare const SKIP_IDENTITY: boolean;
package/dist/envs.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.INTEGRATIONS_FILE = exports.APISERVER_ENDPOINT = exports.CONVERSATION_PROVIDER_FILE = exports.CONVERSATION_PROVIDER = exports.SILERO_VAD_VERSION = exports.UNSTRUCTURED_API_URL = exports.UNSTRUCTURED_API_KEY = exports.NODE_ENV = exports.KNOWLEDGE_BASE_ENABLED = exports.AWS_S3_SECRET_ACCESS_KEY = exports.AWS_S3_REGION = exports.AWS_S3_ENDPOINT = exports.AWS_S3_ACCESS_KEY_ID = exports.SKIP_IDENTITY = void 0;
6
+ exports.SKIP_IDENTITY = exports.OPENAI_API_KEY = exports.INTEGRATIONS_FILE = exports.APISERVER_ENDPOINT = exports.CONVERSATION_PROVIDER_FILE = exports.CONVERSATION_PROVIDER = exports.SILERO_VAD_VERSION = exports.UNSTRUCTURED_API_URL = exports.UNSTRUCTURED_API_KEY = exports.NODE_ENV = exports.KNOWLEDGE_BASE_ENABLED = exports.AWS_S3_SECRET_ACCESS_KEY = exports.AWS_S3_REGION = exports.AWS_S3_ENDPOINT = exports.AWS_S3_ACCESS_KEY_ID = void 0;
7
7
  /*
8
8
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
9
9
  * http://github.com/fonoster/fonoster
@@ -30,7 +30,6 @@ if (process.env.NODE_ENV === "dev") {
30
30
  dotenv_1.default.config({ path: (0, path_1.join)(__dirname, "..", "..", "..", ".env") });
31
31
  }
32
32
  const e = process.env;
33
- exports.SKIP_IDENTITY = e.AUTOPILOT_SKIP_IDENTITY === "true";
34
33
  exports.AWS_S3_ACCESS_KEY_ID = e.AUTOPILOT_AWS_S3_ACCESS_KEY_ID;
35
34
  exports.AWS_S3_ENDPOINT = e.AUTOPILOT_AWS_S3_ENDPOINT;
36
35
  exports.AWS_S3_REGION = e.AUTOPILOT_AWS_S3_REGION ?? "us-east-1";
@@ -53,6 +52,8 @@ exports.APISERVER_ENDPOINT = e.AUTOPILOT_APISERVER_ENDPOINT
53
52
  exports.INTEGRATIONS_FILE = e.AUTOPILOT_INTEGRATIONS_FILE
54
53
  ? e.AUTOPILOT_INTEGRATIONS_FILE
55
54
  : `${process.cwd()}/config/integrations.json`;
55
+ exports.OPENAI_API_KEY = e.AUTOPILOT_OPENAI_API_KEY;
56
+ exports.SKIP_IDENTITY = e.AUTOPILOT_SKIP_IDENTITY === "true";
56
57
  if (exports.SILERO_VAD_VERSION !== "v4" && exports.SILERO_VAD_VERSION !== "v5") {
57
58
  console.error("SILERO_VAD_VERSION must be set to 'v4' or 'v5'");
58
59
  process.exit(1);
@@ -23,10 +23,15 @@ const logger_1 = require("@fonoster/logger");
23
23
  const openai_1 = require("@langchain/openai");
24
24
  const text_splitter_1 = require("langchain/text_splitter");
25
25
  const memory_1 = require("langchain/vectorstores/memory");
26
+ const envs_1 = require("../envs");
26
27
  const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
27
28
  class AbstractKnowledgeBase {
28
29
  constructor(params) {
29
- this.embeddings = params?.embeddings || new openai_1.OpenAIEmbeddings();
30
+ this.embeddings =
31
+ params?.embeddings ||
32
+ new openai_1.OpenAIEmbeddings({
33
+ apiKey: envs_1.OPENAI_API_KEY
34
+ });
30
35
  }
31
36
  async load() {
32
37
  const loaders = (await this.getLoaders());
@@ -1,10 +1,24 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.evaluateTextResponse = evaluateTextResponse;
2
4
  /*
3
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
4
- * Licensed under the MIT License.
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.
5
21
  */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.evaluateTextResponse = evaluateTextResponse;
8
22
  const types_1 = require("./types");
9
23
  async function evaluateTextResponse(expected, aiResponse, testTextSimilarity) {
10
24
  if (expected.type === types_1.ExpectedTextType.EXACT) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/autopilot",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
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,11 +33,11 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@aws-sdk/client-s3": "^3.712.0",
36
- "@fonoster/common": "^0.9.5",
37
- "@fonoster/logger": "^0.9.0",
38
- "@fonoster/sdk": "^0.9.6",
36
+ "@fonoster/common": "^0.9.7",
37
+ "@fonoster/logger": "^0.9.7",
38
+ "@fonoster/sdk": "^0.9.7",
39
39
  "@fonoster/types": "^0.9.0",
40
- "@fonoster/voice": "^0.9.5",
40
+ "@fonoster/voice": "^0.9.8",
41
41
  "@langchain/community": "^0.3.29",
42
42
  "@langchain/core": "^0.3.39",
43
43
  "@langchain/groq": "^0.1.3",
@@ -57,5 +57,5 @@
57
57
  "devDependencies": {
58
58
  "typescript": "^5.5.4"
59
59
  },
60
- "gitHead": "6d8103779798ef80eab629b36f3efe7150e8c0b5"
60
+ "gitHead": "ce8a2ea35fa85d494b158ddb8e61bd92ff2af00b"
61
61
  }