@fonoster/autopilot 0.7.12 → 0.7.13

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,2 +1,3 @@
1
+ export declare const ASSISTANT: string | undefined;
1
2
  export declare const GROQ_API_KEY: string | undefined;
2
3
  export declare const OPENAI_API_KEY: string | undefined;
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.OPENAI_API_KEY = exports.GROQ_API_KEY = void 0;
6
+ exports.OPENAI_API_KEY = exports.GROQ_API_KEY = exports.ASSISTANT = void 0;
7
7
  /*
8
8
  * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
9
9
  * http://github.com/fonoster/fonoster
@@ -23,9 +23,13 @@ exports.OPENAI_API_KEY = exports.GROQ_API_KEY = void 0;
23
23
  * limitations under the License.
24
24
  */
25
25
  const path_1 = require("path");
26
+ const common_1 = require("@fonoster/common");
26
27
  const dotenv_1 = __importDefault(require("dotenv"));
27
28
  if (process.env.NODE_ENV === "dev") {
28
29
  dotenv_1.default.config({ path: (0, path_1.join)(process.cwd(), ".env") });
29
30
  }
31
+ (0, common_1.assertEnvsAreSet)(["ASSISTANT"]);
32
+ (0, common_1.assertFileExists)(process.env.ASSISTANT);
33
+ exports.ASSISTANT = process.env.ASSISTANT;
30
34
  exports.GROQ_API_KEY = process.env.GROQ_API_KEY;
31
35
  exports.OPENAI_API_KEY = process.env.OPENAI_API_KEY;
@@ -1,4 +1,27 @@
1
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.loadAssistantConfig = loadAssistantConfig;
4
27
  /*
@@ -19,8 +42,10 @@ exports.loadAssistantConfig = loadAssistantConfig;
19
42
  * See the License for the specific language governing permissions and
20
43
  * limitations under the License.
21
44
  */
45
+ const path = __importStar(require("path"));
46
+ const envs_1 = require("./envs");
22
47
  const _1 = require(".");
23
48
  function loadAssistantConfig() {
24
- const assistantPath = `${process.cwd()}/etc/assistant.example.json`;
49
+ const assistantPath = path.resolve(process.cwd(), envs_1.ASSISTANT);
25
50
  return (0, _1.loadAndValidateAssistant)(assistantPath);
26
51
  }
@@ -25,6 +25,8 @@ function createPromptTemplate(systemTemplate) {
25
25
  new prompts_1.MessagesPlaceholder("history"),
26
26
  prompts_1.SystemMessagePromptTemplate.fromTemplate(systemTemplate),
27
27
  prompts_1.SystemMessagePromptTemplate.fromTemplate("{context}"),
28
+ // This is how the model will know the current date
29
+ prompts_1.SystemMessagePromptTemplate.fromTemplate(`current date:${new Date().toISOString()}`),
28
30
  prompts_1.HumanMessagePromptTemplate.fromTemplate("{input}")
29
31
  ]);
30
32
  }
package/dist/server.d.ts CHANGED
@@ -1 +1,2 @@
1
+ #!/usr/bin/env node
1
2
  export {};
package/dist/server.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  /*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/autopilot",
3
- "version": "0.7.12",
3
+ "version": "0.7.13",
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",
@@ -18,7 +18,7 @@
18
18
  "generate:readme": "node ../../.scripts/gen-readme.js"
19
19
  },
20
20
  "bin": {
21
- "autopilot": "./dist/runner.js"
21
+ "autopilot": "./dist/server.js"
22
22
  },
23
23
  "files": [
24
24
  "dist",
@@ -35,9 +35,9 @@
35
35
  "url": "https://github.com/fonoster/fonoster/issues"
36
36
  },
37
37
  "dependencies": {
38
- "@fonoster/common": "^0.7.11",
39
- "@fonoster/logger": "^0.7.10",
40
- "@fonoster/voice": "^0.7.12",
38
+ "@fonoster/common": "^0.7.13",
39
+ "@fonoster/logger": "^0.7.13",
40
+ "@fonoster/voice": "^0.7.13",
41
41
  "@langchain/community": "^0.2.31",
42
42
  "@langchain/core": "^0.2.32",
43
43
  "@langchain/groq": "^0.0.17",
@@ -54,5 +54,5 @@
54
54
  "devDependencies": {
55
55
  "typescript": "^5.5.4"
56
56
  },
57
- "gitHead": "264fb6d971bad1d823554e93ed7c088318307184"
57
+ "gitHead": "3f7651d82bbfc749049bd355386f63f1bec3e0d6"
58
58
  }