Skip to content

feat(py/plugins/google-genai): finish_message for image models and effective config echo - #5859

Open
cabljac wants to merge 1 commit into
jh-interactions-1-corefrom
jh-gemini-finish-message
Open

feat(py/plugins/google-genai): finish_message for image models and effective config echo#5859
cabljac wants to merge 1 commit into
jh-interactions-1-corefrom
jh-gemini-finish-message

Conversation

@cabljac

@cabljac cabljac commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Parallel slice of the #5806 split (based on #5854, independent of the Interactions chain): normalizes finish reasons (NO_IMAGE, IMAGE_OTHER), synthesizes finish_message when image models return no media so empty results are not silent successes, propagates finish_message onto candidates, echoes the normalized effective config on response.request, and drops the retired gemini-2.5-flash-image-preview registration.

Part of the stack splitting #5806; recombined it reproduces that PR byte-for-byte. Co-authored with @huangjeff5.

Breaking changes

  • gemini-2.5-flash-image-preview is no longer registered as a model (the GEMINI_2_5_FLASH_IMAGE_PREVIEW enum members remain, but the model name stops resolving). Use gemini-2.5-flash-image.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the deprecated gemini-2.5-flash-image-preview model, introduces a mechanism to track and return the effective configuration (normalized to snake_case and including injected modalities) on the response's request copy, and improves handling of empty or blocked image generation responses by mapping new finish reasons (NO_IMAGE, IMAGE_OTHER) and providing descriptive finish messages. The reviewer suggests fully removing the unused GEMINI_2_5_FLASH_IMAGE_PREVIEW enum members and constants, which were left behind after removing the model from docstrings and registration.

Comment on lines 1042 to 1043
| `gemini-3-pro-image-preview` | Gemini 3 Pro Image Preview | Supported |
| `gemini-2.5-flash-image-preview` | Gemini 2.5 Flash Image Preview | Supported |
| `gemini-2.5-flash-image` | Gemini 2.5 Flash Image | Supported |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While the docstrings for VertexAIGeminiVersion and GoogleAIGeminiVersion have been updated to remove gemini-2.5-flash-image-preview, the actual enum members GEMINI_2_5_FLASH_IMAGE_PREVIEW are still defined in both enum classes, and the constant GEMINI_2_5_FLASH_IMAGE_PREVIEW remains defined in the file. To fully retire this model version, please remove these unused enum members and constants.

…fective config echo

Gemini slice extracted from #5806: normalizes finish reasons (NO_IMAGE,
IMAGE_OTHER), synthesizes finish_message when image models return no
media so empty results are not silent successes, propagates
finish_message onto candidates, echoes the normalized effective config
on response.request for debugging, and drops the retired
gemini-2.5-flash-image-preview registration.

Co-authored-by: Jeff Huang <huangjeff@google.com>
@cabljac
cabljac force-pushed the jh-gemini-finish-message branch from 0f97e7b to c9df52c Compare July 30, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config docs Improvements or additions to documentation go js python Python root tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant