hotfix ts

This commit is contained in:
lloydzhou 2024-07-04 08:36:25 +00:00
parent a68341eae6
commit 97aa72ec5b
3 changed files with 9 additions and 9 deletions

View File

@ -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(

View File

@ -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(

View File

@ -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);