fix: update image models, handle upstream errors in HTTP 200
Three issues found in activity logs: 1. Image model IDs stale — FLUX and Seedream removed from OpenRouter. Updated to current models: Gemini 2.5/3.1 Flash Image, Gemini 3 Pro Image, GPT-5 Image/Mini. Default changed to gemini-2.5-flash-image. 2. openrouter/free router wraps upstream 429 errors in HTTP 200 body with error object. Both text and image response parsers now detect this pattern and surface a proper RuntimeException. 3. Image request used modalities: ["image"] but Gemini needs ["image", "text"]. Updated to include both. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -233,10 +233,12 @@ class PRAutoBlogger_OpenRouter_Image_Provider implements PRAutoBlogger_Image_Pro
|
||||
'messages' => [
|
||||
[
|
||||
'role' => 'user',
|
||||
'content' => $prompt,
|
||||
'content' => 'Generate an image: ' . $prompt,
|
||||
],
|
||||
],
|
||||
'modalities' => [ 'image' ],
|
||||
// Use ["image", "text"] — some providers (Gemini) require both
|
||||
// modalities even when we only want the image output.
|
||||
'modalities' => [ 'image', 'text' ],
|
||||
'image_config' => [
|
||||
'aspect_ratio' => $aspect,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user