-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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] 会话时使用图像沟通报错 #4210
Comments
📦 Deployment environmentVercel 📌 Software version1.20.5 💻 System environmentmacOS 🌐 BrowserEdge 🐛 Problem descriptionWhen uploading pictures for conversation, the error message returned is as follows: 📷 Steps to reproduceUploading any picture for conversation can trigger this error. 🚦 Expected resultsHope the image can be recognized normally 📝 Supplementary informationThe test model is GPT-4 and all models have such error reports. |
👀 @kylyzhh Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. |
Hey @kylyzhh! I'm here to help you with any bugs, questions, or contributions you have. Let's squash those bugs together! 🤖 I found a similar closed issue that might be relevant to your problem: [Bug] 非 gpt-4-vision-preview 模型传图格式. The suggested solution was to ensure that the image URL is correctly parsed and converted to a base64 format. This involves using utility functions like Here is a code snippet that demonstrates how to handle image URLs: case 'image_url': {
const { mimeType, base64, type } = parseDataUri(content.image_url.url);
if (type === 'base64')
return {
source: {
data: base64 as string,
media_type: mimeType as Anthropic.ImageBlockParam.Source['media_type'],
type: 'base64',
},
type: 'image',
};
if (type === 'url') {
const { base64, mimeType } = await imageUrlToBase64(content.image_url.url);
return {
source: {
data: base64 as string,
media_type: mimeType as Anthropic.ImageBlockParam.Source['media_type'],
type: 'base64',
},
type: 'image',
};
}
throw new Error(`Invalid image URL: ${content.image_url.url}`);
} Ensure that the Additionally, the specific requirements and limitations for image formats and sizes when using the OpenAI API are as follows:
Make sure your images comply with these requirements to avoid the "invalid_image" error. |
你的图片链接是啥样的 |
What does your image link look like? |
📦 部署环境
Vercel
📌 软件版本
1.20.5
💻 系统环境
macOS
🌐 浏览器
Edge
🐛 问题描述
上传图片进行对话的时候返回报错信息如下
{
"error": {
"code": "invalid_image",
"type": "invalid_request_error",
"param": null,
"message": "Invalid image."
},
"endpoint": "https://api.openai.com/v1",
"provider": "openai"
}
📷 复现步骤
上传任意图片进行对话即可触发此报错
🚦 期望结果
希望正常识别图像
📝 补充信息
测试模型为GPT-4所有模型均有此类报错
服务搭建在vercel,根据文档完成了所有配置 https://lobehub.com/zh/docs/self-hosting/server-database/vercel
The text was updated successfully, but these errors were encountered: