hotfix ts
This commit is contained in:
parent
a68341eae6
commit
97aa72ec5b
|
@ -146,8 +146,8 @@ async function request(req: NextRequest) {
|
||||||
if (
|
if (
|
||||||
isModelAvailableInServer(
|
isModelAvailableInServer(
|
||||||
serverConfig.customModels,
|
serverConfig.customModels,
|
||||||
jsonBody?.model,
|
jsonBody?.model as string,
|
||||||
ServiceProvider.Anthropic,
|
ServiceProvider.Anthropic as string,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
|
|
|
@ -97,13 +97,13 @@ export async function requestOpenai(req: NextRequest) {
|
||||||
if (
|
if (
|
||||||
isModelAvailableInServer(
|
isModelAvailableInServer(
|
||||||
serverConfig.customModels,
|
serverConfig.customModels,
|
||||||
jsonBody?.model,
|
jsonBody?.model as string,
|
||||||
ServiceProvider.OpenAI,
|
ServiceProvider.OpenAI as string,
|
||||||
) ||
|
) ||
|
||||||
isModelAvailableInServer(
|
isModelAvailableInServer(
|
||||||
serverConfig.customModels,
|
serverConfig.customModels,
|
||||||
jsonBody?.model,
|
jsonBody?.model as string,
|
||||||
ServiceProvider.Azure,
|
ServiceProvider.Azure as string,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
|
|
|
@ -119,9 +119,9 @@ export function collectModelsWithDefaultModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isModelAvailableInServer(
|
export function isModelAvailableInServer(
|
||||||
customModels,
|
customModels: string,
|
||||||
modelName,
|
modelName: string,
|
||||||
providerName,
|
providerName: string,
|
||||||
) {
|
) {
|
||||||
const fullName = `${modelName}@${providerName}`;
|
const fullName = `${modelName}@${providerName}`;
|
||||||
const modelTable = collectModelTable(DEFAULT_MODELS, customModels);
|
const modelTable = collectModelTable(DEFAULT_MODELS, customModels);
|
||||||
|
|
Loading…
Reference in New Issue