Merge pull request #375 from devchat-ai/fix_base_url_error2

Add OPENAI_BASE_URL environment variable
This commit is contained in:
boob.yang 2023-12-21 10:32:47 +08:00 committed by GitHub
commit 9e7f0cd00b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -249,7 +249,7 @@ class DevChat {
// eslint-disable-next-line @typescript-eslint/naming-convention
"OPENAI_API_KEY": llmModelData.api_key,
// eslint-disable-next-line @typescript-eslint/naming-convention
...llmModelData.api_base? { "OPENAI_API_BASE": llmModelData.api_base } : {}
...llmModelData.api_base? { "OPENAI_API_BASE": llmModelData.api_base, "OPENAI_BASE_URL": llmModelData.api_base } : {}
};
// build process options

View File

@ -73,6 +73,7 @@ async function createOpenAiKeyEnv() {
const openAiApiBase = llmModelData.api_base;
if (openAiApiBase) {
envs['OPENAI_API_BASE'] = openAiApiBase;
envs['OPENAI_BASE_URL'] = openAiApiBase;
}
return envs;