-
Notifications
You must be signed in to change notification settings - Fork 183
feat: watsonx multimodal support #2213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sjrl
merged 5 commits into
deepset-ai:main
from
ChinmayBansal:feat/watsonx-multimodal-support
Aug 27, 2025
Merged
feat: watsonx multimodal support #2213
sjrl
merged 5 commits into
deepset-ai:main
from
ChinmayBansal:feat/watsonx-multimodal-support
Aug 27, 2025
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
sjrl
reviewed
Aug 26, 2025
...tions/watsonx/src/haystack_integrations/components/generators/watsonx/chat/chat_generator.py
Outdated
Show resolved
Hide resolved
sjrl
reviewed
Aug 26, 2025
...tions/watsonx/src/haystack_integrations/components/generators/watsonx/chat/chat_generator.py
Outdated
Show resolved
Hide resolved
@ChinmayBansal thanks for your work on this! One high-level comment:
|
sjrl
reviewed
Aug 26, 2025
Hi @sjrl, I have addressed your feedback. Could you review? Thanks! |
sjrl
approved these changes
Aug 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Related Issues
WatsonxChatGenerator
#2131Proposed Changes:
This PR adds multimodal (image + text) support to WatsonxChatGenerator, enabling the component to process
both text and images in chat messages. The implementation follows established patterns from the
AnthropicChatGenerator and LlamaCppChatGenerator multimodal support.
Key Features Added:
Implementation Details:
_prepare_api_call()
method to handle multimodal content while preserving orderImageFormat
andIMAGE_SUPPORTED_FORMATS
type: ignore
directiveHow did you test it?
Unit Tests:
test_prepare_api_call_with_image()
- Tests proper multimodal message conversiontest_prepare_api_call_with_unsupported_mime_type()
- Tests error handling forunsupported formats
test_prepare_api_call_with_none_mime_type()
- Tests edge case with None mime typetest_prepare_api_call_image_in_non_user_message()
- Tests role-based restrictionstest_multimodal_message_processing()
- Tests end-to-end multimodal processing with mocked modeltest_supported_image_formats()
- Tests all supported formats (JPEG, PNG)test_multiple_images_in_single_message()
- Tests multiple image supportIntegration Tests:
test_live_run_multimodal()
- Tests live API calls with real Watson multimodal modelsCode Quality Verification:
hatch run fmt
hatch run test:types
hatch run test:unit
Manual Verification:
Notes for the reviewer
LlamaCppChatGenerator
data:mime-type;base64,data
format withimage_url
structure is required by Watson API for multimodal processingChecklist
guidelines and the
code of conduct
my PR title:
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.