fix: omit stream query parameter when stream is None on interactions get - #2886
Open
adi-IL wants to merge 1 commit into
Open
fix: omit stream query parameter when stream is None on interactions get#2886adi-IL wants to merge 1 commit into
adi-IL wants to merge 1 commit into
Conversation
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.
Summary
Fixes #2661.
In
google/genai/_gaos/google_genai.py,Interactions.get()andAsyncInteractions.get()previously executedstream_bool = bool(_optional_bool(stream, default=False)). This forcedstreamto booleanFalseeven when omitted or set toNone, causingsuper().getto serialize?stream=falseon all HTTP GET requests.During backend rollouts, certain endpoints reject unexpected
?stream=falseparameters withUnknown name "stream".Changes
Interactions.get()andAsyncInteractions.get()ingoogle/genai/_gaos/google_genai.pyto defaultstream: Any = Noneand setstream_bool = _optional_bool(stream). WhenstreamisNone(the default),streamis omitted from serialized query parameters matching howinclude_inputis handled.google/genai/tests/interactions/test_paths.pyto verify that:client.interactions.get(id)andclient.aio.interactions.get(id)omit?streamfrom the request URL.stream=Falseserializes?stream=false.stream=Trueserializes?stream=true.Testing
Ran pytest suite:
google/genai/tests/interactions/test_paths.py: 4 passed.google/genai/tests/interactions/: 40 passed.