@fonoster/autopilot 0.7.26 → 0.7.29
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/handleVoiceRequest.js +4 -4
- package/dist/loadAssistantConfigFromFile.d.ts +3 -0
- package/dist/{loadAssistantConfig.js → loadAssistantConfigFromFile.js} +3 -4
- package/dist/loadKnowledgeBaseFromFile.d.ts +3 -0
- package/dist/{loadKnowledgeBase.js → loadKnowledgeBaseFromFile.js} +3 -3
- package/package.json +6 -6
- package/dist/envs.d.ts +0 -1
- package/dist/envs.js +0 -33
- package/dist/loadAssistantConfig.d.ts +0 -3
- package/dist/loadKnowledgeBase.d.ts +0 -3
|
@@ -55,8 +55,8 @@ exports.handleVoiceRequest = handleVoiceRequest;
|
|
|
55
55
|
const common_1 = require("@fonoster/common");
|
|
56
56
|
const logger_1 = require("@fonoster/logger");
|
|
57
57
|
const createLanguageModel_1 = require("./createLanguageModel");
|
|
58
|
-
const
|
|
59
|
-
const
|
|
58
|
+
const loadAssistantConfigFromFile_1 = require("./loadAssistantConfigFromFile");
|
|
59
|
+
const loadKnowledgeBaseFromFile_1 = require("./loadKnowledgeBaseFromFile");
|
|
60
60
|
const _1 = __importStar(require("."));
|
|
61
61
|
const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
|
|
62
62
|
async function handleVoiceRequest(req, res) {
|
|
@@ -67,8 +67,8 @@ async function handleVoiceRequest(req, res) {
|
|
|
67
67
|
appRef,
|
|
68
68
|
metadata: req.metadata
|
|
69
69
|
});
|
|
70
|
-
const assistantConfig = (0,
|
|
71
|
-
const knowledgeBase = await (0,
|
|
70
|
+
const assistantConfig = (0, loadAssistantConfigFromFile_1.loadAssistantConfigFromFile)(`${process.cwd()}/config/assistant.json`);
|
|
71
|
+
const knowledgeBase = await (0, loadKnowledgeBaseFromFile_1.loadKnowledgeBaseFromFile)(`${process.cwd()}/config/sample.pdf`);
|
|
72
72
|
const voice = new _1.VoiceImpl(sessionRef, res);
|
|
73
73
|
const languageModel = (0, createLanguageModel_1.createLanguageModel)({
|
|
74
74
|
voice,
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
36
|
+
exports.loadAssistantConfigFromFile = loadAssistantConfigFromFile;
|
|
37
37
|
/*
|
|
38
38
|
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
39
39
|
* http://github.com/fonoster/fonoster
|
|
@@ -53,9 +53,8 @@ exports.loadAssistantConfig = loadAssistantConfig;
|
|
|
53
53
|
* limitations under the License.
|
|
54
54
|
*/
|
|
55
55
|
const path = __importStar(require("path"));
|
|
56
|
-
const envs_1 = require("./envs");
|
|
57
56
|
const _1 = require(".");
|
|
58
|
-
function
|
|
59
|
-
const assistantPath = path.resolve(process.cwd(),
|
|
57
|
+
function loadAssistantConfigFromFile(pathToAssistantConfig) {
|
|
58
|
+
const assistantPath = path.resolve(process.cwd(), pathToAssistantConfig);
|
|
60
59
|
return (0, _1.loadAndValidateAssistant)(assistantPath);
|
|
61
60
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.loadKnowledgeBaseFromFile = loadKnowledgeBaseFromFile;
|
|
4
4
|
/*
|
|
5
5
|
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
6
6
|
* http://github.com/fonoster/fonoster
|
|
@@ -20,9 +20,9 @@ exports.loadKnowledgeBase = loadKnowledgeBase;
|
|
|
20
20
|
* limitations under the License.
|
|
21
21
|
*/
|
|
22
22
|
const _1 = require(".");
|
|
23
|
-
async function
|
|
23
|
+
async function loadKnowledgeBaseFromFile(pathToKnowledgeBase) {
|
|
24
24
|
const knowledgeBase = new _1.FilesKnowledgeBase({
|
|
25
|
-
files: [
|
|
25
|
+
files: [pathToKnowledgeBase]
|
|
26
26
|
});
|
|
27
27
|
await knowledgeBase.load();
|
|
28
28
|
return knowledgeBase;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/autopilot",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.29",
|
|
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",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"url": "https://github.com/fonoster/fonoster/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@fonoster/common": "^0.7.
|
|
39
|
-
"@fonoster/logger": "^0.7.
|
|
40
|
-
"@fonoster/types": "^0.7.
|
|
41
|
-
"@fonoster/voice": "^0.7.
|
|
38
|
+
"@fonoster/common": "^0.7.29",
|
|
39
|
+
"@fonoster/logger": "^0.7.29",
|
|
40
|
+
"@fonoster/types": "^0.7.29",
|
|
41
|
+
"@fonoster/voice": "^0.7.29",
|
|
42
42
|
"@langchain/community": "^0.2.31",
|
|
43
43
|
"@langchain/core": "^0.2.32",
|
|
44
44
|
"@langchain/groq": "^0.0.17",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"typescript": "^5.5.4"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "9e147ecc7a4a96641dac70e1ce39af4bae40f396"
|
|
60
60
|
}
|
package/dist/envs.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ASSISTANT: string | undefined;
|
package/dist/envs.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ASSISTANT = void 0;
|
|
7
|
-
/*
|
|
8
|
-
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
9
|
-
* http://github.com/fonoster/fonoster
|
|
10
|
-
*
|
|
11
|
-
* This file is part of Fonoster
|
|
12
|
-
*
|
|
13
|
-
* Licensed under the MIT License (the "License");
|
|
14
|
-
* you may not use this file except in compliance with
|
|
15
|
-
* the License. You may obtain a copy of the License at
|
|
16
|
-
*
|
|
17
|
-
* https://opensource.org/licenses/MIT
|
|
18
|
-
*
|
|
19
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
-
* See the License for the specific language governing permissions and
|
|
23
|
-
* limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
const path_1 = require("path");
|
|
26
|
-
const common_1 = require("@fonoster/common");
|
|
27
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
|
28
|
-
if (process.env.NODE_ENV === "dev") {
|
|
29
|
-
dotenv_1.default.config({ path: (0, path_1.join)(process.cwd(), ".env") });
|
|
30
|
-
}
|
|
31
|
-
(0, common_1.assertEnvsAreSet)(["ASSISTANT"]);
|
|
32
|
-
(0, common_1.assertFileExists)(process.env.ASSISTANT);
|
|
33
|
-
exports.ASSISTANT = process.env.ASSISTANT;
|