feat: CUSTOM_MODELS support mapper

This commit is contained in:
Yidadaa
2023-11-12 00:46:21 +08:00
parent be9774943b
commit a5a1f2e8ad
3 changed files with 27 additions and 17 deletions

View File

@@ -81,7 +81,7 @@ export async function requestOpenai(req: NextRequest) {
const jsonBody = JSON.parse(clonedBody) as { model?: string };
// not undefined and is false
if (modelTable[jsonBody?.model ?? ""] === false) {
if (modelTable[jsonBody?.model ?? ""].available === false) {
return NextResponse.json(
{
error: true,