Skip to content

Commit

Permalink
hotfix ts
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Jul 4, 2024
1 parent a68341e commit 97aa72e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/api/anthropic/[...path]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions app/api/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions app/utils/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 97aa72e

Please sign in to comment.