Deeptrain-Community / chatnio

🚀 Next Generation AI One-Stop Internationalization Solution. 🚀 下一代 AI 一站式 B/C 端解决方案,支持 OpenAI,Midjourney,Claude,讯飞星火,Stable Diffusion,DALL·E,ChatGLM,通义千问,腾讯混元,360 智脑,百川 AI,火山方舟,新必应,Gemini,Moonshot 等模型,支持对话分享,自定义预设,云端同步,模型市场,支持弹性计费和订阅计划模式,支持图片解析,支持联网搜索,支持模型缓存,丰富美观的后台管理与仪表盘数据统计。
https://chatnio.com
Apache License 2.0
2.71k stars 446 forks source link

附件或者图片能否使用base64实现 #215

Closed a8851625 closed 1 week ago

a8851625 commented 1 week ago

如题

少一个服务,部署起来也简单些

Issues-translate-bot commented 1 week ago

Bot detected the issue body's language is not English, translate it automatically.


Title: Can attachments or pictures be implemented using base64?

As title

One less service and easier to deploy

Sh1n3zZ commented 1 week ago

Hi,

chatnio-blob-service 项目附带支持 base64 的选项,不需要其他依赖、支持使用 vercel 进行一键部署 具体请查看 https://github.com/Deeptrain-Community/chatnio-blob-service/ 项目的 README.md

Regrads, Junhai Deng

AnnaStreeter commented 1 week ago

提问题前建议看文档

Issues-translate-bot commented 1 week ago

Bot detected the issue body's language is not English, translate it automatically.


It is recommended to read the documentation before asking questions

a8851625 commented 1 week ago

但是请求到到llm后端的时候是通过 chatnio-blob-service 配置的公网域名url;

我指的是直接到llm后端的时候 就是 base64。

Issues-translate-bot commented 1 week ago

Bot detected the issue body's language is not English, translate it automatically.


But when the request reaches the llm backend, it is the public domain name URL configured through chatnio-blob-service;

What I mean is that when going directly to the llm backend, it is base64.

Sh1n3zZ commented 1 week ago

Hi,

较为冗余,建议使用 vercel 一键快速部署。

Regards, Junhai Deng

Issues-translate-bot commented 1 week ago

Bot detected the issue body's language is not English, translate it automatically.


Hi,

It is relatively redundant. It is recommended to use vercel for one-click rapid deployment.

Regards, Junhai Deng

a8851625 commented 1 week ago

好的,确实是支持,没看清楚;抱歉,不过内容貌似不全:

{"model":"qwen","messages":[{"role":"user","content":"hi"},{"role":"assistant","content":"Hi! How can I help you today? "},{"role":"user","content":"hi"},{"role":"assistant","content":"Hi! How can I assist you today?"},{"role":"user","content":"file\n[[20240618-104928.jpeg]]\ndata:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQA ...\n\n\n图片的内容是啥?"}],"max_tokens":2000,"stream":true,"presence_penalty":0,"frequency_penalty":0,"temperature":0.8,"top_p":1}

Issues-translate-bot commented 1 week ago

Bot detected the issue body's language is not English, translate it automatically.


Okay, it is indeed supported, but I didn’t see it clearly; I’m sorry, but the content seems incomplete:

{"model":"qwen","messages":[{"role":"user","content":"hi"},{"role":"assistant","content":"Hi! How can I help you today? "},{"role":"user","content":"hi"},{"role":"assistant","content":"Hi! How can I assist you today?" },{"role":"user","content":"`file\n[[20240618-104928.jpeg]]\ndata:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQA ...\n`\n\nWhat is the content of the picture? "}],"max_tokens":2000,"stream":true,"presence_penalty":0,"frequency_penalty":0,"temperature":0.8,"top_p": 1}

Sh1n3zZ commented 1 week ago

Hi,

你请求的模型 qwen 不支持图片识别,所以被自动省略了。 当模型不支持图片识别时,经过 base64 编码后的图片会被认为是文本,过长的文本(token)会导致过多的费用,所以采取判断省略用于防止出现该情况。

解决方案:使用支持图片识别的模型。如:gpt-4-vision gpt-4o

Regards, Junhai Deng

Issues-translate-bot commented 1 week ago

Bot detected the issue body's language is not English, translate it automatically.


Hi,

The model qwen you requested does not support image recognition, so it is automatically omitted. When the model does not support image recognition, the base64-encoded image will be considered text. Too long text (token) will result in excessive costs, so judgment omission is used to prevent this situation.

Solution: Use a model that supports image recognition. Such as: gpt-4-vision gpt-4o etc.

Regards, Junhai Deng

zmh-program commented 1 week ago

hey there, your model qwen is not a vision-ability common model, u can use the models mapping or try other models like gpt-4-turbo, claude-3-opus and so on.