Use dotenv
This commit is contained in:
parent
570ad87713
commit
7d975fda8e
13
package-lock.json
generated
13
package-lock.json
generated
|
@ -7,6 +7,7 @@
|
||||||
"name": "Tailchat-Assistant",
|
"name": "Tailchat-Assistant",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
|
"dotenv": "^16.4.5",
|
||||||
"openai": "^4.50.0",
|
"openai": "^4.50.0",
|
||||||
"tailchat-client-sdk": "^1.0.9"
|
"tailchat-client-sdk": "^1.0.9"
|
||||||
},
|
},
|
||||||
|
@ -277,6 +278,18 @@
|
||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dotenv": {
|
||||||
|
"version": "16.4.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz",
|
||||||
|
"integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==",
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://dotenvx.com"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/emoji-regex": {
|
"node_modules/emoji-regex": {
|
||||||
"version": "10.3.0",
|
"version": "10.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz",
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
"description": "Tailchat Assistant is your very own AI-powered chat bot, ready to implement into your guild!",
|
"description": "Tailchat Assistant is your very own AI-powered chat bot, ready to implement into your guild!",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
|
"dotenv": "^16.4.5",
|
||||||
"openai": "^4.50.0",
|
"openai": "^4.50.0",
|
||||||
"tailchat-client-sdk": "^1.0.9"
|
"tailchat-client-sdk": "^1.0.9"
|
||||||
},
|
},
|
||||||
|
@ -14,7 +15,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc -p .",
|
"build": "tsc -p .",
|
||||||
"start": "node --env-file=.env ./dist/bot.js",
|
"start": "node ./dist/bot.js",
|
||||||
"cstart": "npm run build && npm run start",
|
"cstart": "npm run build && npm run start",
|
||||||
"prepare": "husky prepare"
|
"prepare": "husky prepare"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import { Model, Temperature } from "./types";
|
import { Model, Temperature } from "./types";
|
||||||
|
import dotenv from "dotenv";
|
||||||
|
dotenv.config();
|
||||||
|
|
||||||
export const endpoint = process.env.API_ENDPOINT || "http://localhost:8080/v1";
|
export const endpoint = process.env.API_ENDPOINT || "http://localhost:8080/v1";
|
||||||
export const textModel: Model = process.env.TEXT_MODEL || "gpt-4";
|
export const textModel: Model = process.env.TEXT_MODEL || "gpt-4";
|
||||||
|
|
|
@ -22,6 +22,8 @@ import {
|
||||||
} from "./assistant";
|
} from "./assistant";
|
||||||
import { ImagesResponse } from "openai/resources";
|
import { ImagesResponse } from "openai/resources";
|
||||||
import chalk from "chalk";
|
import chalk from "chalk";
|
||||||
|
import dotenv from "dotenv";
|
||||||
|
dotenv.config();
|
||||||
|
|
||||||
// Specific to Tailchat. The endpoint of my Tailchat server, the bot ID and Secret.
|
// Specific to Tailchat. The endpoint of my Tailchat server, the bot ID and Secret.
|
||||||
const HOST = process.env.HOST;
|
const HOST = process.env.HOST;
|
||||||
|
|
Loading…
Reference in a new issue