From 32d788d80814fdcc810f90da353fbd9f339ff93d Mon Sep 17 00:00:00 2001 From: Richard C Lim <61879224+richardclim@users.noreply.github.com> Date: Fri, 31 Jan 2025 22:24:48 -0500 Subject: [PATCH] Update common.ts added baseUrl --- app/api/common.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api/common.ts b/app/api/common.ts index 864f8870f..77c213219 100644 --- a/app/api/common.ts +++ b/app/api/common.ts @@ -54,7 +54,9 @@ export async function requestOpenai(req: NextRequest) { const isAIFoundation = serverConfig.azureUrl?.includes(".models.ai.azure.com"); if (isAIFoundation) { // For AI Foundation, use the path directly without api-version - path = req.nextUrl.pathname.replaceAll("/api/azure/", ""); + baseUrl = serverConfig.azureUrl; + path = "chat/completions"; + // path = req.nextUrl.pathname.replaceAll("/api/azure/", ""); } else { const azureApiVersion = req?.nextUrl?.searchParams?.get("api-version") ||