Skip to content

Commit

Permalink
chore: wip integrating the autopilot with the main project
Browse files Browse the repository at this point in the history
  • Loading branch information
psanders committed Jan 2, 2025
1 parent f82ae5a commit d47132d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
23 changes: 11 additions & 12 deletions mods/autopilot/src/envs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,26 @@ if (process.env.NODE_ENV === "dev") {

const e = process.env;

export const SKIP_IDENTITY = e.AUTOPILOT_SKIP_IDENTITY === "true";
export const AWS_S3_ACCESS_KEY_ID = e.AUTOPILOT_AWS_S3_ACCESS_KEY_ID;
export const AWS_S3_ENDPOINT = e.AUTOPILOT_AWS_S3_ENDPOINT;
export const AWS_S3_REGION = e.AUTOPILOT_AWS_S3_REGION ?? "us-east-1";
export const AWS_S3_SECRET_ACCESS_KEY = e.AUTOPILOT_AWS_S3_SECRET_ACCESS_KEY;
export const KNOWLEDGE_BASE_ENABLED =
e.AUTOPILOT_KNOWLEDGE_BASE_ENABLED === "true";
export const SKIP_IDENTITY = e.SKIP_IDENTITY === "true";
export const AWS_S3_ACCESS_KEY_ID = e.AWS_S3_ACCESS_KEY_ID;
export const AWS_S3_ENDPOINT = e.AWS_S3_ENDPOINT;
export const AWS_S3_REGION = e.AWS_S3_REGION ?? "us-east-1";
export const AWS_S3_SECRET_ACCESS_KEY = e.AWS_S3_SECRET_ACCESS_KEY;
export const KNOWLEDGE_BASE_ENABLED = e.KNOWLEDGE_BASE_ENABLED === "true";
export const NODE_ENV = e.NODE_ENV || "production";
export const UNSTRUCTURED_API_KEY = e.AUTOPILOT_UNSTRUCTURED_API_KEY;
export const UNSTRUCTURED_API_KEY = e.UNSTRUCTURED_API_KEY;
export const UNSTRUCTURED_API_URL =
e.UNSTRUCTURED_API_URL ?? "https://api.unstructuredapp.io/general/v0/general";
export const SILERO_VAD_MODEL_PATH =
e.SILERO_VAD_MODEL_PATH ?? join(__dirname, "..", "silero_vad.onnx");
export const CONVERSATION_PROVIDER = e.AUTOPILOT_CONVERSATION_PROVIDER
export const CONVERSATION_PROVIDER = e.CONVERSATION_PROVIDER
? e.CONVERSATION_PROVIDER
: ConversationProvider.FILE;
export const CONVERSATION_PROVIDER_FILE = e.AUTOPILOT_CONVERSATION_PROVIDER_FILE
export const CONVERSATION_PROVIDER_FILE = e.CONVERSATION_PROVIDER_FILE
? e.CONVERSATION_PROVIDER_FILE
: `${process.cwd()}/config/assistant.json`;
export const AUTOPILOT_APISERVER_ENDPOINT = e.AUTOPILOT_APISERVER_ENDPOINT
? e.AUTOPILOT_APISERVER_ENDPOINT
export const APISERVER_ENDPOINT = e.APISERVER_ENDPOINT
? e.APISERVER_ENDPOINT
: "apiserver:50051";

if (
Expand Down
4 changes: 2 additions & 2 deletions mods/autopilot/src/loadAssistantFromAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
import { VoiceRequest } from "@fonoster/common";
import * as SDK from "@fonoster/sdk";
import { AssistantConfig } from "./assistants";
import { AUTOPILOT_APISERVER_ENDPOINT } from "./envs";
import { APISERVER_ENDPOINT } from "./envs";

function loadAssistantFromAPI(req: VoiceRequest): Promise<AssistantConfig> {
return new Promise((resolve, reject) => {
const clientConfig = {
accessKeyId: req.accessKeyId,
endpoint: AUTOPILOT_APISERVER_ENDPOINT,
endpoint: APISERVER_ENDPOINT,
allowInsecure: true,
withoutInterceptors: true
};
Expand Down

0 comments on commit d47132d

Please sign in to comment.