Update common.ts

added baseUrl
This commit is contained in:
Richard C Lim
2025-01-31 22:24:48 -05:00
committed by GitHub
parent 104264cde7
commit 32d788d808

View File

@@ -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") ||