mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-02-05 17:20:06 +08:00
hotfix ts
This commit is contained in:
parent
a68341eae6
commit
97aa72ec5b
@ -146,8 +146,8 @@ async function request(req: NextRequest) {
|
||||
if (
|
||||
isModelAvailableInServer(
|
||||
serverConfig.customModels,
|
||||
jsonBody?.model,
|
||||
ServiceProvider.Anthropic,
|
||||
jsonBody?.model as string,
|
||||
ServiceProvider.Anthropic as string,
|
||||
)
|
||||
) {
|
||||
return NextResponse.json(
|
||||
|
@ -97,13 +97,13 @@ export async function requestOpenai(req: NextRequest) {
|
||||
if (
|
||||
isModelAvailableInServer(
|
||||
serverConfig.customModels,
|
||||
jsonBody?.model,
|
||||
ServiceProvider.OpenAI,
|
||||
jsonBody?.model as string,
|
||||
ServiceProvider.OpenAI as string,
|
||||
) ||
|
||||
isModelAvailableInServer(
|
||||
serverConfig.customModels,
|
||||
jsonBody?.model,
|
||||
ServiceProvider.Azure,
|
||||
jsonBody?.model as string,
|
||||
ServiceProvider.Azure as string,
|
||||
)
|
||||
) {
|
||||
return NextResponse.json(
|
||||
|
@ -119,9 +119,9 @@ export function collectModelsWithDefaultModel(
|
||||
}
|
||||
|
||||
export function isModelAvailableInServer(
|
||||
customModels,
|
||||
modelName,
|
||||
providerName,
|
||||
customModels: string,
|
||||
modelName: string,
|
||||
providerName: string,
|
||||
) {
|
||||
const fullName = `${modelName}@${providerName}`;
|
||||
const modelTable = collectModelTable(DEFAULT_MODELS, customModels);
|
||||
|
Loading…
Reference in New Issue
Block a user