Update openai.ts

This commit is contained in:
Richard C Lim 2025-02-01 18:41:18 -05:00 committed by GitHub
parent 82f75d9f41
commit 3e18e7b0fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,14 +87,12 @@ export class ChatGPTApi implements LLMApi {
let baseUrl = "";
const isAzure = path.includes("deployments") || accessStore.azureUrl?.includes(".models.ai.azure.com");
if (accessStore.useCustomConfig) {
if (isAzure && !accessStore.isValidAzure()) {
throw Error(
"incomplete azure config, please check it in your settings page",
);
}
baseUrl = isAzure ? accessStore.azureUrl : accessStore.openaiUrl;
}
if (baseUrl.length === 0) {
const isApp = !!getClientConfig()?.isApp;