lobehub/lobe-chat

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

blueman240328 posted onGitHub

💻 系统环境

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


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

posted by lobehubbot 12 months ago
posted by xaya1001 12 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

posted by lobehubbot 12 months ago
posted by arvinxx 12 months ago

✅ @blueman240328

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

posted by lobehubbot 12 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:

posted by lobehubbot 12 months ago

Fund this Issue

$0.00
Funded

Pull requests