Hk-Gosuto / ChatGPT-Next-Web-LangChain

一键拥有你自己的 ChatGPT 网页服务。 One-Click to deploy your own ChatGPT web UI.(基于 langchain 实现的插件版本 Plugin version implemented based on langchain)
https://n3xt.chat
MIT License
1.07k stars 394 forks source link

[Bug] Gemini 模型鉴权异常 #136

Closed happychos closed 6 months ago

happychos commented 6 months ago

为了提高交流效率,我们设立了官方 QQ 群和 QQ 频道,如果你在使用或者搭建过程中遇到了任何问题,请先第一时间加群或者频道咨询解决,除非是可以稳定复现的 Bug 或者较为有创意的功能建议,否则请不要随意往 Issue 区发送低质无意义帖子。

点击加入官方群聊

反馈须知

⚠️ 注意:不遵循此模板的任何帖子都会被立即关闭,如果没有提供下方的信息,我们无法定位你的问题。

请在下方中括号内输入 x 来表示你已经知晓相关内容。

描述问题 使用的google_api_key,其他模型用one-api,Gemini-Pro改为流式响应更新后不可用,同样的参数回滚到上一个版本就没有问题,

如何复现 更新后发现gemini-pro不可用,回滚后可用。

截图 请在此提供控制台截图、屏幕截图或者服务端的 log 截图。

一些必要的信息

Issues-translate-bot commented 6 months ago

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


Title: Gemini-Pro changed to streaming response and is unavailable after update

In order to improve communication efficiency, we have set up an official QQ group and QQ channel. If you encounter any problems during use or construction, please join the group or channel for consultation as soon as possible, unless it is a bug that can be stably reproduced or More creative feature suggestions, otherwise please do not send low-quality and meaningless posts to the Issue area.

Click to join the official group chat

Feedback Instructions

⚠️ NOTE: Any post that does not follow this template will be immediately closed and we will not be able to locate your issue without providing the information below.

Please enter x in the square brackets below to indicate that you already know the relevant content.

Describe the problem The google_api_key used, other models use one-api, Gemini-Pro is changed to streaming response and is unavailable after the update. There is no problem if the same parameters are rolled back to the previous version.

How ​​to reproduce After the update, it was found that gemini-pro was not available, but it was available after rolling back.

screenshot Please provide console screenshots, screenshots, or server-side log screenshots here.

Some necessary information

MuRo-J commented 6 months ago

+1,测试接口

 curl \
  -H 'Content-Type: application/json' \
  -d '{"contents":[{"parts":[{"text":"say hello~"}]}]}' \
  -X POST https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:streamGenerateContent\?key\=key

可用,部署后没用

Issues-translate-bot commented 6 months ago

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


+1, test interface


curl\
-H 'Content-Type: application/json' \
-d '{"contents":[{"parts":[{"text":"say hello~"}]}]}' \
-X POST https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:streamGenerateContent\?key\=key

Available, useless after deployment  
Hk-Gosuto commented 6 months ago

是否配置了 GOOGLE_BASE_URL 对应原版参数为 GOOGLE_URL 原版需要配置为 https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:streamGenerateContent 本项目配置为 https://generativelanguage.googleapis.com 此处存在差异,检查一下配置是否正确

Issues-translate-bot commented 6 months ago

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


Whether GOOGLE_BASE_URL is configured, the corresponding original parameter is GOOGLE_URL The original version needs to be configured as https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:streamGenerateContent This project is configured as https://generativelanguage.googleapis.com There are differences here, check if the configuration is correct

MuRo-J commented 6 months ago

谢谢作者,辛苦您啦 我确认了下Server的log显示

[Base Url] https://generativelanguage.googleapis.com
[Server Config] using 1 of 1 api key

然后 网站的log显示

[30/Dec/2023:00:31:30 +0800] "POST /api/google/v1/models/gemini-pro:streamGenerateContent HTTP/2.0" 401 40 
ychappyboy commented 6 months ago

是否配置了 GOOGLE_BASE_URL 对应原版参数为 GOOGLE_URL 原版需要配置为 https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:streamGenerateContent 本项目配置为 https://generativelanguage.googleapis.com 此处存在差异,检查一下配置是否正确

我试了加了GOOGLE_BASE_URL还是不行,但是去掉CODE参数就一切正常了,加了CODE gemini pro就不可用,但是其他模型可用。

Issues-translate-bot commented 6 months ago

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


Whether GOOGLE_BASE_URL is configured, the corresponding original parameter is GOOGLE_URL The original version needs to be configured as https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:streamGenerateContent This project is configured as https://generativelanguage.googleapis.com There are differences here, check whether the configuration is correct

I tried adding GOOGLE_BASE_URL but it still didn't work, but removing the CODE parameter made everything normal.

Hk-Gosuto commented 6 months ago

[Base Url] https://generativelanguage.googleapis.com

我试了一下 确实是 gemini 模型鉴权的问题,该问题很快会被修复

Issues-translate-bot commented 6 months ago

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


[Base Url] https://generativelanguage.googleapis.com

I tried it and it is indeed a gemini model authentication problem. This problem will be fixed soon.