Skip to content
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

Fix #5449: Add the functionality to convert the image urls to base64 data for the Anthropic #5476

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

GurneeshBudhiraja
Copy link

@GurneeshBudhiraja GurneeshBudhiraja commented Apr 1, 2025

Fix: #5449
Hi, I’m Gurneesh, and this was my first time contributing to this repository.

Changes Made

  1. Created a new file named base64-utils.ts and added a utility function, convertImageUrlToBase64, which converts image data from a URL into Base64 format.
  2. Integrated the convertImageUrlToBase64 function into convert-to-anthropic-messages-prompt.ts, conditionally retrieving the Base64 data and constructing the object accordingly.
  3. Updated the test file convert-to-anthropic-messages-prompt.test.ts to verify the correctness of the above changes.

Thanks, and I’m looking forward to any feedback or suggestions 😀!

…mage urls into base64 data.

-integrate the function `convertImageUrlToBase64` in `convert-to-anthropic-messages-prompt.ts` to convert image urls into the base64 format.
-update the test result data for the image urls.
@GurneeshBudhiraja GurneeshBudhiraja force-pushed the fix/5449-Anthropic-image-url-support branch from 72c8c7c to 02e1a66 Compare April 1, 2025 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Vertex Anthropic Image URL Support
1 participant