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

[Bug] gemini-1.5-pro-latest 模型无法使用 #2847

Closed jrr997 closed 2 months ago

jrr997 commented 3 months ago

📦 部署环境

📌 软件版本

我用的是PWA

💻 系统环境

🌐 浏览器

🐛 问题描述

gemini-1.5-pro-latest model 接口错误[400 Bad Request]

📷 复现步骤

  1. Language Model 中 Connectivity Check 通过。

    image
  2. 在 Just Chat 中输入 'hello' 后接口报错,错误信息如下:

{
  "error": {
    "message": "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:streamGenerateContent?alt=sse: [400 Bad Request] Invalid JSON payload received. Unknown name \"maxItems\" at 'tools[0].function_declarations[0].parameters.properties[0].value': Cannot find field.\nInvalid JSON payload received. Unknown name \"minItems\" at 'tools[0].function_declarations[0].parameters.properties[0].value': Cannot find field.\nInvalid JSON payload received. Unknown name \"default\" at 'tools[0].function_declarations[0].parameters.properties[1].value': Cannot find field.\nInvalid JSON payload received. Unknown name \"default\" at 'tools[0].function_declarations[0].parameters.properties[3].value': Cannot find field.\nInvalid JSON payload received. Unknown name \"default\" at 'tools[0].function_declarations[0].parameters.properties[4].value': Cannot find field. [{\"@type\":\"type.googleapis.com/google.rpc.BadRequest\",\"fieldViolations\":[{\"field\":\"tools[0].function_declarations[0].parameters.properties[0].value\",\"description\":\"Invalid JSON payload received. Unknown name \\\"maxItems\\\" at 'tools[0].function_declarations[0].parameters.properties[0].value': Cannot find field.\"},{\"field\":\"tools[0].function_declarations[0].parameters.properties[0].value\",\"description\":\"Invalid JSON payload received. Unknown name \\\"minItems\\\" at 'tools[0].function_declarations[0].parameters.properties[0].value': Cannot find field.\"},{\"field\":\"tools[0].function_declarations[0].parameters.properties[1].value\",\"description\":\"Invalid JSON payload received. Unknown name \\\"default\\\" at 'tools[0].function_declarations[0].parameters.properties[1].value': Cannot find field.\"},{\"field\":\"tools[0].function_declarations[0].parameters.properties[3].value\",\"description\":\"Invalid JSON payload received. Unknown name \\\"default\\\" at 'tools[0].function_declarations[0].parameters.properties[3].value': Cannot find field.\"},{\"field\":\"tools[0].function_declarations[0].parameters.properties[4].value\",\"description\":\"Invalid JSON payload received. Unknown name \\\"default\\\" at 'tools[0].function_declarations[0].parameters.properties[4].value': Cannot find field.\"}]}]"
  },
  "provider": "google"
}

🚦 期望结果

接口不要报错

📝 补充信息

No response

lobehubbot commented 3 months ago

👀 @jrr997

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

xingpingcn commented 3 months ago

你的key估计被谷歌限制了,你所在地区用不了,或者请求过多了

lobehubbot commented 3 months ago

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


Your key is probably restricted by Google and cannot be used in your area, or there are too many requests.

xingpingcn commented 3 months ago

你用vercel部署,然后在环境变量里填上你的key,这样子就能用vercel的服务器帮你请求(选一个没有被限制的区域部署,例如美国)

lobehubbot commented 3 months ago

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


You use vercel to deploy, and then fill in your key in the environment variable, so that you can use vercel's server to help you request (choose an unrestricted region for deployment, such as the United States)

jrr997 commented 3 months ago

你的key估计被谷歌限制了,你所在地区用不了,或者请求过多了

看接口返回应该不是这个问题。我刚刚在 chatbox 上测试了我的 key,是可以正常使用的。

lobehubbot commented 3 months ago

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


Your key is probably restricted by Google and cannot be used in your area, or there are too many requests.

Judging from the interface return, this should not be the problem. I just tested my key on chatbox and it works fine.

xingpingcn commented 3 months ago

你的key估计被谷歌限制了,你所在地区用不了,或者请求过多了

看接口返回应该不是这个问题。我刚刚在 chatbox 上测试了我的 key,是可以正常使用的。

如果你用的官网preview,然后你的代理软件并没有代理preview的话,那请求Gemini就是直连的。

刚刚测试我的Gemini在最新版没有问题,而且也不太应该出问题,lobe用的官方sdk

lobehubbot commented 3 months ago

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


Your key is probably restricted by Google and cannot be used in your area, or there are too many requests.

Judging from the interface return, this should not be the problem. I just tested my key on chatbox and it works fine.

If you use the official website for preview, and your proxy software does not proxy preview, then requesting Gemini will be directly connected.

I just tested my Gemini and there is no problem in the latest version, and it is unlikely to have problems. The official sdk used by lobe

sxjeru commented 3 months ago

请检查插件是否全部关闭。

lobehubbot commented 3 months ago

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


Please check if all plug-ins are closed.

jrr997 commented 3 months ago

请检查插件是否全部关闭。

谢谢,是插件的问题。我把 Dalle 3 插件关了就好了。感觉插件应该要有检查模型是否合适的机制。

lobehubbot commented 3 months ago

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


Please check if all plug-ins are closed.

Thank you, it's a plug-in problem. I just turned off the Dalle 3 plugin. I feel that the plug-in should have a mechanism to check whether the model is suitable.

lobehubbot commented 2 months ago

✅ @jrr997

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