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: support base64 encoded image_url for gemini-pro-vision #872

Merged
merged 2 commits into from
Jan 1, 2024

Conversation

Laisky
Copy link
Contributor

@Laisky Laisky commented Dec 27, 2023

背景

OpenAI 的 vision request 里提交的 image_url 是支持两种格式的:URL 或 base64 encoded image。

https://platform.openai.com/docs/guides/vision/uploading-base-64-encoded-images

但是 relay-gemini 里只支持了 URL,本 patch 就是为其增加 based64 的支持

修复

增强了 GetImageFromUrl 这个函数,让其同时支持 URL 和 base64 encoded image。

自测

我已确认该 PR 已自测通过

CleanShot 2023-12-27 at 11 19 44@2x

CleanShot 2023-12-27 at 11 18 09@2x

Laisky and others added 2 commits December 27, 2023 03:14
@songquanpeng songquanpeng changed the title fix: Support base64 encoded image_url for gemini-pro-vision fix: support base64 encoded image_url for gemini-pro-vision Jan 1, 2024
@songquanpeng songquanpeng merged commit 7772064 into songquanpeng:main Jan 1, 2024
@songquanpeng
Copy link
Owner

Thx~

greeeds pushed a commit to greeeds/one-api that referenced this pull request Mar 3, 2024
- Add support for base64 encoded image in OpenAI's image_url

Co-authored-by: JustSong <39998050+songquanpeng@users.noreply.github.com>
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.

None yet

2 participants