mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-10-13 04:59:51 +08:00
refactor: hardcode model validation token budget
This commit is contained in:
@@ -15,7 +15,6 @@ import {
|
||||
isAihubmixStandardBaseURL,
|
||||
normalizeMiniMaxBaseURL,
|
||||
} from "@/lib/ai-providers"
|
||||
import { resolveModelValidationMaxTokens } from "@/lib/model-validation"
|
||||
import { allowPrivateUrls, isPrivateUrl } from "@/lib/ssrf-protection"
|
||||
import { PROVIDER_INFO, type ProviderName } from "@/lib/types/model-config"
|
||||
|
||||
@@ -48,10 +47,6 @@ export async function POST(req: Request) {
|
||||
// Note: Express Mode only needs vertexApiKey
|
||||
vertexApiKey,
|
||||
} = body
|
||||
const validationMaxTokens = resolveModelValidationMaxTokens(
|
||||
process.env.MODEL_VALIDATION_MAX_TOKENS,
|
||||
)
|
||||
|
||||
if (!provider || !modelId) {
|
||||
return NextResponse.json(
|
||||
{ valid: false, error: "Provider and model ID are required" },
|
||||
@@ -303,7 +298,7 @@ export async function POST(req: Request) {
|
||||
messages: [
|
||||
{ role: "user", content: "Say 'OK'" },
|
||||
],
|
||||
max_tokens: validationMaxTokens,
|
||||
max_tokens: 1000,
|
||||
stream: true,
|
||||
enable_thinking: false,
|
||||
}),
|
||||
@@ -417,7 +412,7 @@ export async function POST(req: Request) {
|
||||
await generateText({
|
||||
model,
|
||||
prompt: "Say 'OK'",
|
||||
maxOutputTokens: validationMaxTokens,
|
||||
maxOutputTokens: 1000,
|
||||
})
|
||||
const responseTime = Date.now() - startTime
|
||||
|
||||
|
||||
Reference in New Issue
Block a user