feat: 强制 max_tokens=2048 限制

This commit is contained in:
zimk
2026-03-23 01:32:28 +08:00
parent a5033fa52b
commit 8ca8a6ce85

View File

@@ -70,6 +70,8 @@ async function handleChat(request, env) {
return json({ error: 'Invalid JSON body' }, 400, request, env);
}
payload.max_tokens = 2048;
const upstream = await fetch(joinUrl(env.OPENAI_BASE_URL, '/v1/chat/completions'), {
method: 'POST',
headers: {