Skip to content

fix(agent_engines): support types.Content and List[types.Part] in async_stream_query#5892

Open
ishanrajsingh wants to merge 2 commits intogoogleapis:mainfrom
ishanrajsingh:fix-adk-multimodal-message-3106
Open

fix(agent_engines): support types.Content and List[types.Part] in async_stream_query#5892
ishanrajsingh wants to merge 2 commits intogoogleapis:mainfrom
ishanrajsingh:fix-adk-multimodal-message-3106

Conversation

@ishanrajsingh
Copy link

  • 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-docs#930

…] 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
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: vertex-ai Issues related to the googleapis/python-aiplatform API. labels Oct 7, 2025
@ishanrajsingh ishanrajsingh changed the title Fix google/adk-python#3106: Support types.Content and List[types.Part] in async_stream_query fix(agent_engines): support types.Content and List[types.Part] in async_stream_query Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: vertex-ai Issues related to the googleapis/python-aiplatform API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant