mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-09-27 13:46:37 +08:00
Update common.ts
This commit is contained in:
parent
22da0d4bfc
commit
e3e456e434
@ -49,11 +49,15 @@ const isAzure = req.nextUrl.pathname.includes("azure/deployments") || Boolean(se
|
||||
);
|
||||
|
||||
if (isAzure) {
|
||||
const isAIFoundation = serverConfig.azureUrl?.includes(".models.ai.azure.com");
|
||||
if (!isAIFoundation) {
|
||||
// const isAIFoundation = serverConfig.azureUrl?.includes(".models.ai.azure.com");
|
||||
const azureApiVersion =
|
||||
req?.nextUrl?.searchParams?.get("api-version") ||
|
||||
serverConfig.azureApiVersion;
|
||||
const isAIFoundation = baseUrl.includes(".models.ai.azure.com");
|
||||
if (isAIFoundation) {
|
||||
// For AI Foundation models, use direct path without deployments
|
||||
path = "chat/completions";
|
||||
} else {
|
||||
baseUrl = baseUrl.split("/deployments").shift() as string;
|
||||
|
||||
// Forward compatibility:
|
||||
|
Loading…
Reference in New Issue
Block a user