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

[Bug] Issues with Media Uploads for Gemini and Claude #3473

Closed
samkurd opened this issue Aug 14, 2024 · 21 comments · Fixed by #3870
Closed

[Bug] Issues with Media Uploads for Gemini and Claude #3473

samkurd opened this issue Aug 14, 2024 · 21 comments · Fixed by #3870
Labels
🐛 Bug Something isn't working | 缺陷 released

Comments

@samkurd
Copy link

samkurd commented Aug 14, 2024

📦 Environment

Vercel

📌 Version

v1.10.1

💻 Operating System

Windows

🌐 Browser

Edge

🐛 Bug Description

Hello,

I have been experiencing issues with media uploads in the lobe-chat repository. I have deployed the application using Vercel and have set up the database using Neon. Additionally, I am using Cloudflare for DNS handling.

Details:

Deployment Environment:

Platform: Vercel
Database: Neon
DNS Handling: Cloudflare
Issue Description:

Previous Behavior: Before the v1.10.1 update, there were errors with media uploads across all language models.
Current Behavior: After updating to v1.10.1, media uploads work fine with OpenAI. However, I am encountering errors when using the Gemini and Claude language models.
Error Messages:

Gemini:

"Error requesting Google service, please troubleshoot or retry based on the following information"

{ "error": { "message": "currently we don't support image url: https://mydomain.com/files/478784/8e3cec19-9eae-442d-91b4-4791cc58f4bb.jpg" }, "provider": "google" }

Claude:

"Error requesting Anthropic service, please troubleshoot or retry based on the following information"

{ "error": { "error": { "type": "error", "error": { "type": "invalid_request_error", "message": "messages.0.content.1.image.source.base64.media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp'" } }, "status": 400, "headers": { "via": "1.1 google", "date": "Wed, 14 Aug 2024 07:34:00 GMT", "connection": "keep-alive", "request-id": "req_01LzcGdawx4398ndPL78KsKg", "content-type": "application/json", "x-robots-tag": "none", "content-length": "193", "x-should-retry": "false", "x-cloud-trace-context": "6a3fcc084a2ee937518088998956b28c" } }, "endpoint": "https://api.anthropic.com", "provider": "anthropic" }

This is the error I get on my Browser console:
https://mydomain.com/api/chat/google 471

📷 Recurrence Steps

  1. Deploy the lobe-chat application using Vercel.
  2. Set up the database using Neon.
  3. Configure DNS handling with Cloudflare and R2 Storage.
  4. Attempt to upload media using the Gemini and Claude language models.

🚦 Expected Behavior

Media uploads should work seamlessly across all language models, including Gemini and Claude.

📝 Additional Information

No response

@samkurd samkurd added the 🐛 Bug Something isn't working | 缺陷 label Aug 14, 2024
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Aug 14, 2024
@lobehubbot
Copy link
Member

👀 @samkurd

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@Zolyn
Copy link
Contributor

Zolyn commented Aug 14, 2024

#3370 is addressing this issue.

@samkurd
Copy link
Author

samkurd commented Aug 15, 2024

#3370 seems to address only Gemini, but I'm facing issues with Claude too. Does that fix also solves the issue with Claude?

@adminewacc
Copy link

adminewacc commented Sep 4, 2024

trying to solve this problem too, if i can, i will say here how

@samkurd
Copy link
Author

samkurd commented Sep 4, 2024

I'm looking forward to your solution, thanks @adminewacc

@adminewacc
Copy link

adminewacc commented Sep 4, 2024

almost solved ( claude lol )

@samkurd
Copy link
Author

samkurd commented Sep 5, 2024

That's a great news

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


That's a great news

@adminewacc
Copy link

adminewacc commented Sep 5, 2024

solved, i later will try to request it

@adminewacc
Copy link

tommorrow i solved it but i forgot to post here lol

@samkurd
Copy link
Author

samkurd commented Sep 6, 2024

Oh that's amazing, thanks @adminewacc

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Oh that's amazing, thanks @adminewacc

@github-project-automation github-project-automation bot moved this from Roadmap - Chat 1.x to Done in Lobe Chat Routine Sep 9, 2024
@lobehubbot
Copy link
Member

@samkurd

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

@lobehubbot
Copy link
Member

🎉 This issue has been resolved in version 1.15.30 🎉

The release is available on:

Your semantic-release bot 📦🚀

@samkurd
Copy link
Author

samkurd commented Sep 10, 2024

unfortunately the error is still available and unresolved.

@arvinxx
Copy link
Contributor

arvinxx commented Sep 10, 2024

@samkurd please share more info about the error you meet.

@samkurd
Copy link
Author

samkurd commented Sep 10, 2024

This is the error I'm facing:

Error requesting Anthropic service, please troubleshoot or retry based on the following information

{
"error": {
"error": {
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "messages.0.content.1.image.source.base64.data: The image was specified using the image/png media type, but does not appear to be a valid png image"
}
},
"status": 400,
"headers": {
"via": "1.1 google",
"date": "Tue, 10 Sep 2024 14:53:31 GMT",
"connection": "keep-alive",
"request-id": "req_019vWkbWd7H9i6wDvLcRbfLG",
"content-type": "application/json",
"x-robots-tag": "none",
"content-length": "216",
"x-should-retry": "false",
"x-cloud-trace-context": "7b9beefcef835dcdec7c555695c927e1"
},
"request_id": "req_019vWkbWd7H9i6wDvLcRbfLG"
},
"endpoint": "https://api.anthropic.com",
"provider": "anthropic"
}

Screenshot 2024-09-10 170217

@arvinxx
Copy link
Contributor

arvinxx commented Sep 10, 2024

@samkurd what's the image you use?

@samkurd
Copy link
Author

samkurd commented Sep 10, 2024

so I did a little digging, it only accepts png files and in my tests no other image format is supported.

@samkurd
Copy link
Author

samkurd commented Sep 12, 2024

all fixed and working with OpenAI, Gemini and Claude.

@ous50
Copy link

ous50 commented Sep 14, 2024

Is it possible to adapt this method to all of the model providers? I have built an One-API server, from which I may use Claude, Gemini, ChatGPT, etc. by simply configuring the OpenAI's API. When I was using Gemini with OpenAI config, it just returns:

image

{
"error": {
"code": "image_url_invalid",
"type": "one_hub_error",
"message": "请求上游地址失败 (request id: 202409150736377660162153tPnPuIK)"
},
"endpoint": "https://www/v1",
"provider": "openai"
}

and with google provider it works perfectly:

Screenshot 2024-09-15 at 12 38 48 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷 released
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants