fix: set max output tokens to 16384 for all LLM providers

OpenAI's default output limit (4096 tokens) was too low for structured
synthesis output with multiple categories and articles per category,
causing truncated JSON. Set 16384 for both OpenAI APIs (Responses +
Chat Completions) and Gemini. Anthropic already had 16384.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
master
oabrivard 3 months ago
parent fdb3110407
commit 8a18b70aff

@ -138,7 +138,8 @@ fn build_request_body(
}, },
"generationConfig": { "generationConfig": {
"responseMimeType": "application/json", "responseMimeType": "application/json",
"responseSchema": response_schema "responseSchema": response_schema,
"maxOutputTokens": 16384
} }
}); });

@ -44,6 +44,7 @@ impl OpenAiProvider {
"model": model, "model": model,
"instructions": system_prompt, "instructions": system_prompt,
"input": user_prompt, "input": user_prompt,
"max_output_tokens": 16384,
"text": { "text": {
"format": { "format": {
"type": "json_schema", "type": "json_schema",
@ -116,6 +117,7 @@ impl OpenAiProvider {
"content": user_prompt "content": user_prompt
} }
], ],
"max_tokens": 16384,
"response_format": { "response_format": {
"type": "json_schema", "type": "json_schema",
"json_schema": { "json_schema": {

Loading…
Cancel
Save