fix(models): send temperature and top_p on interactions API requests - #7376
Open
donggyun112 wants to merge 1 commit into
Open
donggyun112 wants to merge 1 commit into
donggyun112 wants to merge 1 commit into
Conversation
google-genai 2.26 declares temperature and top_p on the interactions GenerationConfig, but build_generation_config still dropped them as parameters the client cannot carry, so a configured temperature never reached the API. Send them; top_k is still undeclared and stays dropped.
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.
build_generation_configdropstemperature,top_pandtop_kas parameters google-genai cannot carry on an interactions request. Since google-genai 2.26.0,GenerationConfigParamdeclarestemperatureandtop_p, so a configured temperature is still dropped by ADK, and the warning blames the client.test_dropped_parameters_are_the_ones_the_request_cannot_carryhas been failing on main since 2.26.0.Send
temperatureandtop_p.top_kis still undeclared and stays dropped with its warning.Testing Plan
Unit tests
TestBuildGenerationConfignow expectstemperatureandtop_pin the built config and onlytop_kin the client-side warning.Manual E2E
Gemini(model="gemini-2.5-flash", use_interactions_api=True)withtemperature=0, six runs of a "random number" prompt against the live API. On main the request carries nogeneration_configand returns six different numbers. With this change it sends{"temperature": 0.0}and returns the same two numbers as a directclient.aio.interactions.create(..., generation_config={"temperature": 0}).