Update common.ts

This commit is contained in:
Richard C Lim 2025-02-02 19:06:37 -05:00 committed by GitHub
parent f55a173cc3
commit 6b6fd6997d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -59,6 +59,7 @@ console.log("[Auth Value Present]", !!authValue);
req?.nextUrl?.searchParams?.get("api-version") ||
serverConfig.azureApiVersion;
const isAIFoundation = baseUrl.includes(".models.ai.azure.com");
console.log("[Is AI Foundation]", isAIFoundation);
if (isAIFoundation) {
// For AI Foundation models, use direct path without deployments
// failed to work. path = "chat/completions";
@ -104,6 +105,7 @@ console.log("[Auth Value Present]", !!authValue);
}
}
}
console.log("[Final Path]", path);
}
const fetchUrl = cloudflareAIGatewayUrl(`${baseUrl}/${path}`);