mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 05:32:41 +08:00
hotfix
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { getServerSideConfig } from "../config/server";
|
||||
import { DEFAULT_MODELS, OPENAI_BASE_URL, GEMINI_BASE_URL } from "../constant";
|
||||
import {
|
||||
DEFAULT_MODELS,
|
||||
OPENAI_BASE_URL,
|
||||
GEMINI_BASE_URL,
|
||||
ServiceProvider,
|
||||
} from "../constant";
|
||||
import { isModelAvailableInServer } from "../utils/model";
|
||||
import { makeAzurePath } from "../azure";
|
||||
|
||||
@@ -90,7 +95,16 @@ export async function requestOpenai(req: NextRequest) {
|
||||
|
||||
// not undefined and is false
|
||||
if (
|
||||
isModelAvailableInServer(serverConfig.customModels, jsonBody?.model)
|
||||
isModelAvailableInServer(
|
||||
serverConfig.customModels,
|
||||
jsonBody?.model,
|
||||
ServiceProvider.OpenAI,
|
||||
) ||
|
||||
isModelAvailableInServer(
|
||||
serverConfig.customModels,
|
||||
jsonBody?.model,
|
||||
ServiceProvider.Azure,
|
||||
)
|
||||
) {
|
||||
return NextResponse.json(
|
||||
{
|
||||
|
Reference in New Issue
Block a user