mirror of
https://github.com/JimLiu/baoyu-skills.git
synced 2026-07-12 22:09:48 +08:00
516803feb4
The `wants_generated` detection checks `candidate[12][7][0]` and an old `googleusercontent.com/image_generation_content/` URL pattern in the response text. Both are no longer present in the current Gemini Web API response format, causing the entire generated-image extraction block to be skipped even when Gemini successfully generates images — resulting in "No image returned in response" errors. Generated image URLs now appear as `https://lh3.googleusercontent.com/gg-dl/` somewhere in the response parts. This commit adds an unconditional fallback that scans all response parts for those URLs when `generated_images` is still empty after the existing `wants_generated` block, reusing the already-present `collect_strings` helper and `GeneratedImage` constructor. The existing code path is untouched — the fallback only runs when no images were found through the original logic, so old response formats continue to work.