-
Notifications
You must be signed in to change notification settings - Fork 8.2k
fix: Standardize content dict format for LLM provider compatibility #9745
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
Merged
Changes from 5 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
d4ff91e
🔧 (image.py): refactor create_image_content_dict function to return a…
Cristhianzl f2f708a
✅ (test_image_utils.py): update image content dict format for better …
Cristhianzl 6f641dc
[autofix.ci] apply automated fixes
autofix-ci[bot] 289c5bd
Merge branch 'release-1.6.0' into cz/fix-image-send-llms
carlosrcoelho 574f1ad
Merge branch 'release-1.6.0' into cz/fix-image-send-llms
carlosrcoelho 890f7ec
✨ (test_image_providers.py): add integration tests for image content …
Cristhianzl eda3ee2
Merge branch 'cz/fix-image-send-llms' of github.com:langflow-ai/langf…
Cristhianzl 5c95f0d
[autofix.ci] apply automated fixes
autofix-ci[bot] eea5a6f
📝 (general-bugs-agent-images-playground.spec.ts): update file path fo…
Cristhianzl f175450
Merge branch 'cz/fix-image-send-llms' of github.com:langflow-ai/langf…
Cristhianzl f6a5070
🐛 (general-bugs-agent-images-playground.spec.ts): Fix bug in test cas…
Cristhianzl 93b7d8e
🐛 (general-bugs-agent-images-playground.spec.ts): fix file path for i…
Cristhianzl 625c842
Merge branch 'release-1.6.0' into cz/fix-image-send-llms
Cristhianzl 57a4e53
[autofix.ci] apply automated fixes
autofix-ci[bot] 0029c54
Merge branch 'release-1.6.0' into cz/fix-image-send-llms
Cristhianzl 1cb099a
✅ (test_image_utils.py): update test_image_content_dict_format_compat…
Cristhianzl af73684
Merge branch 'cz/fix-image-send-llms' of github.com:langflow-ai/langf…
Cristhianzl b07b0dc
Merge branch 'release-1.6.0' into cz/fix-image-send-llms
Cristhianzl 1aaded2
Merge branch 'release-1.6.0' into cz/fix-image-send-llms
jordanrfrazier 74dde8b
Merge branch 'release-1.6.0' into cz/fix-image-send-llms
lucaseduoli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
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.
@Cristhianzl Doesnt this change with respect to the providers?
@coderabbitai review the format with respect to providers like openai and anthropic. and google gen ai
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.
for base64 images.
Assessment
Your change is correct for OpenAI compatibility, but it creates a provider-specific format issue. The new format works perfectly for OpenAI APIs but won't work for Anthropic or Google Gemini without additional transformation.
Recommendation
Since this appears to be a multimodal content function that might be used across different providers, consider:
The current change is correct if this function is specifically intended for OpenAI integration, but problematic if it needs to work with other providers.
Would you like me to help implement a more flexible solution that supports multiple providers?
🤔 This format difference across providers is quite interesting - each has their own approach to handling multimodal content!
✏️ Learnings added
Uh oh!
There was an error while loading. Please reload this page.
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.
@edwinjosechittilappilly I don't think so.
I tested all the providers with Agent, LLM and chat image.
It's in the video the manual test changing the providers: https://www.loom.com/share/37eda4d9939743ba8986eefb9e3f2cd8
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.