fix(agent_engines): support types.Content and List[types.Part] in async_stream_query#5892
Open
ishanrajsingh wants to merge 2 commits intogoogleapis:mainfrom
Open
fix(agent_engines): support types.Content and List[types.Part] in async_stream_query#5892ishanrajsingh wants to merge 2 commits intogoogleapis:mainfrom
ishanrajsingh wants to merge 2 commits intogoogleapis:mainfrom
Conversation
…] in async_stream_query - Add support for google.genai.types.Content objects as message parameter - Add support for List[types.Part] for multimodal inputs (text, images, files) - Add _process_message_to_content helper method for type conversion - Update type hints to reflect new supported types - Maintains backward compatibility with str and Dict inputs This fix enables the documented multimodal query functionality that was previously raising TypeError when using types.Content or types.Part objects. Testing: Manual testing required with google-adk installed. Related issue: google/adk-python#3106
…] in async_stream_query - Add support for google.genai.types.Content objects as message parameter - Add support for List[types.Part] for multimodal inputs (text, images, files) - Add _process_message_to_content helper method for type conversion - Update type hints in async_stream_query signature - Maintains backward compatibility with str and Dict inputs This enables the documented multimodal query functionality that was previously raising TypeError when using types.Content or types.Part objects. The issue occurred because async_stream_query only accepted str or Dict, but documentation showed examples using types.Content and List[types.Part]. Changes: - Added _process_message_to_content() method to handle all input types - Updated async_stream_query() type annotation to include new types - Preserves existing behavior for string and dictionary inputs - Properly converts Content and Part objects to expected format Testing: Manual verification required with google-adk installed. See test_multimodal_manual.py for test scenarios. Related issue: google/adk-python#3106
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.
This enables the documented multimodal query functionality that was
previously raising TypeError when using types.Content or types.Part objects.
The issue occurred because async_stream_query only accepted str or Dict,
but documentation showed examples using types.Content and List[types.Part].
Changes:
Testing: Manual verification required with google-adk installed.
See test_multimodal_manual.py for test scenarios.
Related issue: google/adk-docs#930