-
Notifications
You must be signed in to change notification settings - Fork 306
Anthropic image format fix #1273
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
Conversation
Reformat OpenAI image content item to Claude format. Also fix an issue processing the system message when the system message content is a list instead of a string.
@jk10001 please sign the CLA: https://cla-assistant.io/ag2ai/ag2?pullRequest=1273 |
@jk10001 thanks so much for creating this, would you be able to add some tests? |
Tests updated for conversion of image messages to Anthropic format.
@marklysze I've added some additional tests into test_anthropic.py. |
Great, thanks @jk10001, for the tests... I tried this with the MultimodalConversableAgent with some tweaks in img_utils and it worked well for OCR. Would you have a simple example of how you use this? The reason I ask is it would be good to add to the Anthropic Model page in the docs and for testing. |
…into anthropic_image_fix
Hi @marklysze, here's a simple example adapting the code in the notebook https://docs.ag2.ai/docs/use-cases/notebooks/notebooks/agentchat_lmm_gpt-4v
|
@jk10001 that's handy, thank you! We'll add that example into the docs separately. I'm good to move this out of draft for a review if you are. |
@marklysze good with me, thanks! |
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.
Nice work @jk10001, appreciate the enhancement
Codecov ReportAttention: Patch coverage is
... and 63 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Why are these changes needed?
Reformatting of messages containing images from OpenAI format to Claude format.
Also change system message handling so that message lists can be processed as well as strings.
Related issue number
Checks