Open sonnyding1 opened 5 hours ago
👀 @sonnyding1
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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
@sonnyding1 你好!我是Dosu,一个可以帮助您解决bug、回答问题并成为贡献者的机器人。在等待人类维护者的过程中,我会尽力帮助您。
I found a similar closed issue regarding image upload problems with the GPT-4o model. The issue was resolved by upgrading to the latest version and clearing the browser's data and history. It was suggested that there might have been a bug related to the search and adding an online model not originally supported. Additionally, refreshing the model list in the settings allowed the user to upload images again [1].
In your case, the error message indicates that the context length exceeded the model's maximum limit of 128,000 tokens. This could be due to the way images are being uploaded as byte streams, which might be inflating the token count. You might want to check if the image is being converted to base64 format before sending it to the OpenAI API, as this is the method used in the lobe-chat framework [2][3].
To address the issue, consider the following steps:
These steps might help in resolving the issue with image uploads exceeding the context length.
To continue talking to Dosu, mention @dosu.
图片是啥样的?
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
What does the picture look like? You haven't changed this recently, right?
知道为啥了,我修下
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
I know why, I'll fix it
📦 Environment
Official Preview
📌 Version
v1.26.11
💻 Operating System
macOS
🌐 Browser
Other
🐛 Bug Description
原来可以正常上传图片,现在不行了,可能是因为把图片作为byte stream直接上传到OpenAI API,而不是根据https://platform.openai.com/docs/guides/vision 的方法上传。我得到的error是context length exceeded,也就是说上传一张~170kb的图片直接让一个request超过了128k的context window。具体的log如下:
请尽快修复,我尝试上传~40kb的图片,结果一条request就花了~$0.2,显然是把这40kb的图片算成request中的40k了。
📷 Recurrence Steps
No response
🚦 Expected Behavior
No response
📝 Additional Information
No response