[mirotalk] - #170 add basePath in OpenAiApi

This commit is contained in:
Miroslav Pejic
2023-07-19 07:43:49 +02:00
parent 155e85bb06
commit 30e55757c7
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -82,6 +82,7 @@ SLACK_SIGNING_SECRET=YourSlackSigningSecret
# 3. Generate your APIKey https://platform.openai.com/account/api-keys
CHATGPT_ENABLED=false
CHATGPT_BASE_PATH=https://api.openai.com/v1/
CHATGTP_APIKEY=YourOpenAiApiKey
CHATGPT_MODEL=text-davinci-003
CHATGPT_MAX_TOKENS=1000
+2
View File
@@ -176,6 +176,7 @@ if (sentryEnabled) {
let chatGPT;
const configChatGPT = {
enabled: getEnvBoolean(process.env.CHATGPT_ENABLED),
basePath: process.env.CHATGPT_BASE_PATH,
apiKey: process.env.CHATGTP_APIKEY,
model: process.env.CHATGTP_MODEL,
max_tokens: parseInt(process.env.CHATGPT_MAX_TOKENS),
@@ -185,6 +186,7 @@ if (configChatGPT.enabled) {
if (configChatGPT.apiKey) {
const { Configuration, OpenAIApi } = require('openai');
const configuration = new Configuration({
basePath: configChatGPT.basePath,
apiKey: configChatGPT.apiKey,
});
chatGPT = new OpenAIApi(configuration);