fix(api-nodes): edge cases in responses for Gemini models - #10860
Merged
Conversation
Kosinkadink
approved these changes
Nov 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gemini-3-Pro-Image: When the user enters a help-style prompt (e.g.,
help,help me) with response modality set toIMAGE, the API may returnpromptFeedback=None. This fix detects that case and surfaces the appropriate error message instead of failing silently.Gemini-2.5-flash-image: With
modality=IMAGEand a help-style prompt, the response can containusageMetadata.candidatesTokensDetails=None. Add a null guard so we don’t attempt to enumerate aNoneTypeand spam the logs.Docs: Update the
aspect_ratiodescription for Gemini-3-Pro to be more accurate.Sampling defaults: Stop hard-coding model parameters (e.g.,
temperature,topK) in the Pydantic model. Recent Google docs recommend leavingtemperatureunset and note that defaults vary by model. We were also sendingtopK=40while theGemini-3-Pro-Imagemodel default is64; rely on backend defaults instead. Reference: https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/3-pro-imageAPI Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms