ChatGPTNextWeb / ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT/Gemini 应用。
https://app.nextchat.dev/
MIT License
74.32k stars 58.68k forks source link

[Bug] [一些问题合集] 包括:[配置了代理的Gemini用不了、设定了默认模型后列表出现undefined等等] #5030

Closed charle00001 closed 1 month ago

charle00001 commented 1 month ago

📦 部署方式

Cloudflare Pages & Vercel

📌 软件版本

v2.13.0, v2.12.4

💻 系统环境

Other Linux

📌 系统版本

Debian 12 (这个不重要吧?)

🌐 浏览器

Firefox

📌 浏览器版本

115.12.0 esr (64 位)

🐛 问题描述

部署方式:Cloudflare Pages & Vercel

CF Pages的变量与 Vercel 的变量全程一致

之前是用了 2.12.4 这个版本,配置了Gemini,配置了Gemini的代理(代理接口 fakecat.vercel.app),还配置了一些模型(glm4之类的,不过都不是官方接口,是一个公益接口,接口格式是OpenAI),描述一下两个版本问题:

v2.12.4

这个版本的问题是 Cloudflare Pages 独有的 Gemini(配置了代理),使用 Gemini 的时候返回了代理接口的页面 HTML;而在 Vercel 上部署它就没问题(Gemini+代理),正常返回内容。我猜测这个问题是 Cloudflare Pages 没有去请求它的确切接口,而是直接请求了它的域名

v2.13.0:

这个版本的问题 Cloudflare Pages 和 Vercel 都有 Gemini(配置了代理),使用 Gemini 的时候它去请求了那个公益接口!也就是说,它直接请求了base_url,没有请求google_url,离谱

另外,设置的默认模型之后,模型列表最上面有一个undifined,反正看着不舒服就对了(

图:

Vercel & CF Pages:

图片

📷 复现步骤

在“问题描述”一栏已经写了

🚦 期望结果

总结:

希望修复(Cloudflare Pages):

使用Gemini时请求base_url而不请求google_url的问题

使用Gemini时,直接返回代理接口的(index.html)的问题

接口选择列表,设置了默认模型后,最顶部出现“undefined”的问题

希望修复(Vercel):

使用Gemini时请求base_url而不请求google_url的问题

接口选择列表,设置了默认模型后,最顶部出现“undefined”的问题

📝 补充信息

另:之前 Vercel 的版本因为未知原因没有升级成功,导致了我拿了 v2.12.4 版本的 Vercel 与 v2.13.0 版本的 CF Pages 比较,出现了一些误会(现在 Vercel 也有了一些问题,在“期望结果”一栏中。)

就这些问题,当然CF Pages的部署方式是测试阶段,所以后续有问题我会反馈,谢谢!(我感觉 v2.13.0 的更新很坏,更新了那个,影响了这个)

Issues-translate-bot commented 1 month ago

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


Title: [Bug] After deploying nextchat on cloudflare pages, gemini configured with a proxy cannot be used.

📦 Deployment method

Other

📌 Software version

v2.13.0, v2.12.4

💻 System environment

Other Linux

📌 System version

Debian 12 (This is not important, right?)

🌐 Browser

Firefox

📌 Browser version

115.12.0 esr (64-bit)

🐛 Problem description

Deployment method: Cloudflare Pages

The variables of cf pages are the same as those of vercel

I used version 2.12.4 before, configured gemini, configured gemini's agent, and also configured general gpt (glm4 or something, but it is not an official interface, it is a public welfare interface). Let me describe the two versions. :

v2.12.4: gemini (proxy is configured, proxy interface fakecat.vercel.app), when using gemini, the page html of the proxy interface is returned; but there is no problem when deploying it on vercel (gemini + proxy), and the content is returned normally. My guess is that the problem is that cloudflare does not request its exact interface, but directly requests its domain name

v2.13.0: gemini (configured proxy, proxy interface fakecat.vercel.app), when using gemini, it requested the public welfare interface! It directly requested base_url and did not request google_url, which is outrageous

Another: After setting the default model, there is an undefined at the top

picture:

vercel:

Picture

cf pages:

Picture

📷 Steps to reproduce

Already written in the "Problem Description" column

🚦 Expected results

Summarize:

Hope fixed (all happening in cloudflare pages):

The problem of requesting base_url instead of google_url when using gemini

When using gemini, the problem of directly returning the proxy interface (index.html)

In the interface selection list, after setting the default model, an "undefined" problem appears at the top.

Interface selection list, the variables are consistent but inconsistent with vercel (there is a comparison picture above)

📝 Supplementary information

Regarding these issues, of course the deployment method of cf pages is at a relatively unstable stage, so I will provide feedback if there are any problems in the future, thank you!

charle00001 commented 1 month ago

[补充]

Cloudflare Pages Env:

Variable name Value
BASE_URL https://api.example.com
CODE Value encrypted
CUSTOM_MODELS -all,+gemini-1.0-pro=Gemini-Pro-1.0,+gemini-1.5-pro-latest=Gemini-Pro-1.5,+gemini-1.5-flash-latest=Gemini-Flash-1.5,+gemini-pro-vision,+gpt-4-turbo-1106=GPT-4,+glm-v4=GLM-4,+chatglm_pro=ChatGLM-PRO,+claude-3-opus=Claude3-OPUS
DEFAULT_MODEL gemini-1.5-pro-latest
ENABLE_BALANCE_QUERY 1
GOOGLE_API_KEY Value encrypted
GOOGLE_URL https://fakecat.vercel.app
HIDE_USER_API_KEY 1
NEXT_TELEMETRY_DISABLE 1
NODE_VERSION 20.1
OPENAI_API_KEY Value encrypted
PHP_VERSION 7.4
PROTOCOL https
YARN_VERSION 1.22.19

Vercel Env:

Variable name Value
BASE_URL https://api.example.com
CODE Value encrypted
CUSTOM_MODELS -all,+gemini-1.0-pro=Gemini-Pro-1.0,+gemini-1.5-pro-latest=Gemini-Pro-1.5,+gemini-1.5-flash-latest=Gemini-Flash-1.5,+gemini-pro-vision,+gpt-4-turbo-1106=GPT-4,+glm-v4=GLM-4,+chatglm_pro=ChatGLM-PRO,+claude-3-opus=Claude3-OPUS
DEFAULT_MODEL gemini-1.5-pro-latest
ENABLE_BALANCE_QUERY 1
GOOGLE_API_KEY Value encrypted
GOOGLE_URL https://fakecat.vercel.app
HIDE_USER_API_KEY 1
OPENAI_API_KEY Value encrypted
PROTOCOL https
charle00001 commented 1 month ago

另:我更改了第一条issue,但是翻译没更改,望周知

Issues-translate-bot commented 1 month ago

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


Another: I changed the first issue, but the translation has not changed. Hope you know.

i-square commented 1 month ago

v2.13.0 今天刚升级

除了undefined问题,我还有个问题,没有配置 AZURE_URL,但是模型列表里会多出几个模型比如: gpt-4(AZURE)gpt-4o(AZURE)

Issues-translate-bot commented 1 month ago

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


v2.13.0 Just upgraded today

In addition to the undefined problem, I have another problem. AZURE_URL is not configured, but there will be several more models in the model list, such as: gpt-4(AZURE), gpt-4o(AZURE)

lloydzhou commented 1 month ago

@i-square

我还有个问题,没有配置 AZURE_URL,但是模型列表里会多出几个模型比如: gpt-4(AZURE)、gpt-4o(AZURE)

这里之所以出现这个选项,原因在于:v2.13.0版本之后,Azure被提升到与OpenAI, Google等一个级别的供应商了,所以,这里逻辑上应该要展示。

Issues-translate-bot commented 1 month ago

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


@i-square I still have a problem. AZURE_URL is not configured, but there will be several more models in the model list, such as: gpt-4(AZURE), gpt-4o(AZURE)

The reason why this option appears here is that after version v2.13.0, Azure has been promoted to the same level of suppliers as OpenAI, Google, etc., so it should be displayed here logically.

charle00001 commented 1 month ago

一会之前我更新到了v2.13.1,测试了一通,发现了之前的反馈还是不够详细,所以补充一下:

“为什么使用Gemini的时候它不请求google_url而是请求base_url?”

因为我设置了“DEFAULT_MODEL”。不知道为啥,将“DEFAULT_MODEL”设置为gemini-1.5-pro-latest之后,它就认为它是gemini-1.5-pro-latest@openai了,总之,设置了DEFAULT_MODEL变量之后,任何非openai接口格式的model都会被以为是openai接口格式。

但是,当你直接在模型选择里面选择gemini-1.5-pro-latest而不是undefined,它就正常了

另:这个版本还是有undefined,没修复

Issues-translate-bot commented 1 month ago

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


I updated to v2.13.1 a while ago, tested it, and found that the previous feedback was still not detailed enough, so I will add:

"Why does it not request google_url but base_url when using Gemini?"

Because I set "DEFAULT_MODEL". I don’t know why, but after setting “DEFAULT_MODEL” to gemini-1.5-pro-latest, it thinks it is gemini-1.5-pro-latest@openai. In short, after setting the DEFAULT_MODEL variable, any non-openai interface format The model will be considered to be the openai interface format.

However, when you directly select gemini-1.5-pro-latest instead of undefined in the model selection, it works fine.

Another: This version still has undefined, which has not been fixed.

charle00001 commented 1 month ago

一会之前我更新到了v2.13.1,测试了一通,发现了之前的反馈还是不够详细,所以补充一下:

“为什么使用Gemini的时候它不请求google_url而是请求base_url?”

因为我设置了“DEFAULT_MODEL”。不知道为啥,将“DEFAULT_MODEL”设置为gemini-1.5-pro-latest之后,它就认为它是gemini-1.5-pro-latest@openai了,总之,设置了DEFAULT_MODEL变量之后,任何非openai接口格式的model都会被以为是openai接口格式。

但是,当你直接在模型选择里面选择gemini-1.5-pro-latest而不是undefined,它就正常了

另:这个版本还是有undefined,没修复

同样的,上面描述的问题在Vercel和Cloudflare Pages中都有

还有一个,现在Cloudflare Pages里面使用gemini后,它不显示代理接口的index.html了,它报错了这个:

{
  "error": {
    "code": 403,
    "message": "Method doesn't allow unregistered callers (callers without established identity). Please use API Key or other form of API consumer identity to call this API.",
    "status": "PERMISSION_DENIED"
  }
}

重复,除了几个必须要添加的变量以外,Cf Pages的变量与Vercel的一致

另:那几个变量是这些↓,在“这里

    NODE_VERSION=20.1
    NEXT_TELEMETRY_DISABLE=1
    YARN_VERSION=1.22.19
    PHP_VERSION=7.4
i-square commented 1 month ago

@i-square

我还有个问题,没有配置 AZURE_URL,但是模型列表里会多出几个模型比如: gpt-4(AZURE)、gpt-4o(AZURE)

这里之所以出现这个选项,原因在于:v2.13.0版本之后,Azure被提升到与OpenAI, Google等一个级别的供应商了,所以,这里逻辑上应该要展示。

@lloydzhou 但我并没有配置任何AZURE模型和AZURE地址,为什么会展示AZURE的东西?

Issues-translate-bot commented 1 month ago

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


@i-square

I still have a problem. AZURE_URL is not configured, but there will be several more models in the model list, such as: gpt-4(AZURE), gpt-4o(AZURE)

The reason why this option appears here is that after version v2.13.0, Azure has been promoted to the same level of suppliers as OpenAI, Google, etc., so it should be displayed here logically.

@lloydzhou But I have not configured any AZURE model or AZURE address. Why is AZURE displayed?

charle00001 commented 1 month ago

关了,大部分问题解决了

Issues-translate-bot commented 1 month ago

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


Shut it down and most of the problems are solved.