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
8040433c35
commit
104264cde7
@ -51,6 +51,11 @@ export async function requestOpenai(req: NextRequest) {
|
||||
);
|
||||
|
||||
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 =
|
||||
req?.nextUrl?.searchParams?.get("api-version") ||
|
||||
serverConfig.azureApiVersion;
|
||||
@ -85,6 +90,7 @@ export async function requestOpenai(req: NextRequest) {
|
||||
console.log("[Replace with DeployId", realDeployName);
|
||||
path = path.replaceAll(modelName, realDeployName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user