@fonoster/autopilot 0.9.5 → 0.9.7
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 +2 -1
- package/dist/envs.js +23 -21
- package/dist/knowledge/AbstractKnowledgeBase.js +4 -1
- package/package.json +6 -6
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 =
|
|
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,28 +30,30 @@ 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.
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.KNOWLEDGE_BASE_ENABLED = e.KNOWLEDGE_BASE_ENABLED === "true";
|
|
33
|
+
exports.AWS_S3_ACCESS_KEY_ID = e.AUTOPILOT_AWS_S3_ACCESS_KEY_ID;
|
|
34
|
+
exports.AWS_S3_ENDPOINT = e.AUTOPILOT_AWS_S3_ENDPOINT;
|
|
35
|
+
exports.AWS_S3_REGION = e.AUTOPILOT_AWS_S3_REGION ?? "us-east-1";
|
|
36
|
+
exports.AWS_S3_SECRET_ACCESS_KEY = e.AUTOPILOT_AWS_S3_SECRET_ACCESS_KEY;
|
|
37
|
+
exports.KNOWLEDGE_BASE_ENABLED = e.AUTOPILOT_KNOWLEDGE_BASE_ENABLED === "true";
|
|
39
38
|
exports.NODE_ENV = e.NODE_ENV || "production";
|
|
40
|
-
exports.UNSTRUCTURED_API_KEY = e.
|
|
41
|
-
exports.UNSTRUCTURED_API_URL = e.
|
|
42
|
-
|
|
43
|
-
exports.
|
|
44
|
-
|
|
39
|
+
exports.UNSTRUCTURED_API_KEY = e.AUTOPILOT_UNSTRUCTURED_API_KEY;
|
|
40
|
+
exports.UNSTRUCTURED_API_URL = e.AUTOPILOT_UNSTRUCTURED_API_URL ??
|
|
41
|
+
"https://api.unstructuredapp.io/general/v0/general";
|
|
42
|
+
exports.SILERO_VAD_VERSION = e.AUTOPILOT_SILERO_VAD_VERSION ?? "v5";
|
|
43
|
+
exports.CONVERSATION_PROVIDER = e.AUTOPILOT_CONVERSATION_PROVIDER
|
|
44
|
+
? e.AUTOPILOT_CONVERSATION_PROVIDER
|
|
45
45
|
: types_1.ConversationProvider.FILE;
|
|
46
|
-
exports.CONVERSATION_PROVIDER_FILE = e.
|
|
47
|
-
? e.
|
|
46
|
+
exports.CONVERSATION_PROVIDER_FILE = e.AUTOPILOT_CONVERSATION_PROVIDER_FILE
|
|
47
|
+
? e.AUTOPILOT_CONVERSATION_PROVIDER_FILE
|
|
48
48
|
: `${process.cwd()}/config/assistant.json`;
|
|
49
|
-
exports.APISERVER_ENDPOINT = e.
|
|
50
|
-
? e.
|
|
49
|
+
exports.APISERVER_ENDPOINT = e.AUTOPILOT_APISERVER_ENDPOINT
|
|
50
|
+
? e.AUTOPILOT_APISERVER_ENDPOINT
|
|
51
51
|
: "apiserver:50051";
|
|
52
|
-
exports.INTEGRATIONS_FILE = e.
|
|
53
|
-
? e.
|
|
52
|
+
exports.INTEGRATIONS_FILE = e.AUTOPILOT_INTEGRATIONS_FILE
|
|
53
|
+
? e.AUTOPILOT_INTEGRATIONS_FILE
|
|
54
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";
|
|
55
57
|
if (exports.SILERO_VAD_VERSION !== "v4" && exports.SILERO_VAD_VERSION !== "v5") {
|
|
56
58
|
console.error("SILERO_VAD_VERSION must be set to 'v4' or 'v5'");
|
|
57
59
|
process.exit(1);
|
|
@@ -66,8 +68,8 @@ if (exports.CONVERSATION_PROVIDER.toLocaleLowerCase() === types_1.ConversationPr
|
|
|
66
68
|
}
|
|
67
69
|
if (exports.KNOWLEDGE_BASE_ENABLED) {
|
|
68
70
|
(0, common_1.assertEnvsAreSet)([
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
71
|
+
"AUTOPILOT_AWS_S3_ACCESS_KEY_ID",
|
|
72
|
+
"AUTOPILOT_AWS_S3_SECRET_ACCESS_KEY",
|
|
73
|
+
"AUTOPILOT_UNSTRUCTURED_API_KEY"
|
|
72
74
|
]);
|
|
73
75
|
}
|
|
@@ -23,10 +23,13 @@ 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 = params?.embeddings || new openai_1.OpenAIEmbeddings({
|
|
31
|
+
apiKey: envs_1.OPENAI_API_KEY
|
|
32
|
+
});
|
|
30
33
|
}
|
|
31
34
|
async load() {
|
|
32
35
|
const loaders = (await this.getLoaders());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/autopilot",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
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.
|
|
37
|
-
"@fonoster/logger": "^0.9.
|
|
38
|
-
"@fonoster/sdk": "^0.9.
|
|
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.
|
|
40
|
+
"@fonoster/voice": "^0.9.7",
|
|
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": "
|
|
60
|
+
"gitHead": "58373b604b2e29bcfc6b88a2f30ae45afb4e97a7"
|
|
61
61
|
}
|