mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-09-27 21:56:38 +08:00
Update common.ts
This commit is contained in:
parent
8040433c35
commit
104264cde7
@ -51,6 +51,11 @@ export async function requestOpenai(req: NextRequest) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (isAzure) {
|
if (isAzure) {
|
||||||
|
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/", "");
|
||||||
|
} else {
|
||||||
const azureApiVersion =
|
const azureApiVersion =
|
||||||
req?.nextUrl?.searchParams?.get("api-version") ||
|
req?.nextUrl?.searchParams?.get("api-version") ||
|
||||||
serverConfig.azureApiVersion;
|
serverConfig.azureApiVersion;
|
||||||
@ -85,6 +90,7 @@ export async function requestOpenai(req: NextRequest) {
|
|||||||
console.log("[Replace with DeployId", realDeployName);
|
console.log("[Replace with DeployId", realDeployName);
|
||||||
path = path.replaceAll(modelName, realDeployName);
|
path = path.replaceAll(modelName, realDeployName);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user