From e0f6ffdec1929a5064215170454e828a42b5a5a6 Mon Sep 17 00:00:00 2001 From: Richard C Lim <61879224+richardclim@users.noreply.github.com> Date: Sat, 1 Feb 2025 04:52:50 -0500 Subject: [PATCH] Update openai.ts --- app/client/platforms/openai.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index 706952d5c..71d93504e 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -99,8 +99,13 @@ export class ChatGPTApi implements LLMApi { if (baseUrl.length === 0) { const isApp = !!getClientConfig()?.isApp; + const isAIFoundation = accessStore.azureUrl?.includes(".models.ai.azure.com"); + if (isAzure && isAIFoundation) { + baseUrl = accessStore.azureUrl || ""; + } else { const apiPath = isAzure ? ApiPath.Azure : ApiPath.OpenAI; baseUrl = isApp ? OPENAI_BASE_URL : apiPath; + } } if (baseUrl.endsWith("/")) {