lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Vision/TTS) and plugin system. One-click FREE deployment of your private ChatGPT/ Claude application.
https://chat-preview.lobehub.com
Other
42.12k stars 9.5k forks source link

模型选择 Gemini 1.5 ,但是请求地址还是 gemini-pro? #1794

Closed blueman240328 closed 6 months ago

blueman240328 commented 6 months ago

💻 系统环境

Windows

📦 部署环境

Vercel / Zeabur / Sealos

🌐 浏览器

Chrome

🐛 问题描述

模型选择 Gemini 1.5 或 Gemini ultra, 但是错误信息是从 gemini-pro 返回的,这是不是可以认为并没有成功请求到 gemini-1.5-pro-latest. (已确认 api 有 1.5 和 ultra 的调用权限)

image_2024-03-28_23-24-51

{
  "error": {
    "message": "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:streamGenerateContent?alt=sse: [400 Bad Request] Please ensure that multiturn requests ends with a user role or a function response."
  },
  "provider": "google"
}

🚦 期望结果

如果选择的 gemini-pro-vision ,那么错误信息就是从 /models/gemini-pro-vision 返回的,据此推断如果正常请求 gemini-1.5-pro-latest,那么错误信息也会从 /models/gemini-1.5-pro-latest 返回。

image

📷 复现步骤

根据错误信息, gemini 的对话必须从 user role 开始,那么如果把历史消息数限制在双数,就会返回上述错误,根据返回的错误信息,发现是从 /models/gemini-pro 的请求地址返回的,并不是选择的 /models/gemini-1.5-pro-latest 的地址返回

📝 补充信息

No response

lobehubbot commented 6 months ago

👀 @blueman240328

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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

xaya1001 commented 6 months ago

https://github.com/lobehub/lobe-chat/discussions/1284#discussioncomment-8942220 来这里投票吧,希望能更新一下

lobehubbot commented 6 months ago

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


https://github.com/lobehub/lobe-chat/discussions/1284#discussioncomment-8942220 Come here to vote, I hope it will be updated

blueman240328 commented 6 months ago

https://github.com/lobehub/lobe-chat/issues/1769#issuecomment-2024577454

arvinxx commented 6 months ago

写了下 RFC: https://github.com/lobehub/lobe-chat/discussions/1796

lobehubbot commented 6 months ago

✅ @blueman240328

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

lobehubbot commented 6 months ago

:tada: This issue has been resolved in version 0.145.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: