mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-09-28 06:06:38 +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) {
|
if (isAzure) {
|
||||||
const isAIFoundation = serverConfig.azureUrl?.includes(".models.ai.azure.com");
|
// const isAIFoundation = serverConfig.azureUrl?.includes(".models.ai.azure.com");
|
||||||
if (!isAIFoundation) {
|
|
||||||
const azureApiVersion =
|
const azureApiVersion =
|
||||||
req?.nextUrl?.searchParams?.get("api-version") ||
|
req?.nextUrl?.searchParams?.get("api-version") ||
|
||||||
serverConfig.azureApiVersion;
|
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;
|
baseUrl = baseUrl.split("/deployments").shift() as string;
|
||||||
|
|
||||||
// Forward compatibility:
|
// Forward compatibility:
|
||||||
|
Loading…
Reference in New Issue
Block a user