Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
R917C opened this issue Jul 16, 2024 · 15 comments
Assignees
Labels
bug Something isn't working

Comments

@R917C
Copy link

R917C commented Jul 16, 2024

📦 部署方式

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 的更新很坏,更新了那个,影响了这个)

@R917C R917C added the bug Something isn't working label Jul 16, 2024
@Issues-translate-bot

This comment was marked as outdated.

@R917C
Copy link
Author

R917C commented Jul 17, 2024

[补充]

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

@R917C R917C changed the title [Bug] 在cloudflare pages部署了nextchat之后,配置了代理的gemini用不了 [Bug] [一些问题合集] 在Cloudflare Pages部署了nextchat之后,配置了代理的gemini用不了 Jul 17, 2024
@R917C R917C changed the title [Bug] [一些问题合集] 在Cloudflare Pages部署了nextchat之后,配置了代理的gemini用不了 [Bug] [一些问题合集] 包括:[配置了代理的Gemini用不了、设定了默认模型后列表出现undefined等等] Jul 17, 2024
@R917C
Copy link
Author

R917C commented Jul 17, 2024

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

@Issues-translate-bot
Copy link

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.

@Dogtiti Dogtiti mentioned this issue Jul 19, 2024
10 tasks
@i-square
Copy link

v2.13.0 今天刚升级

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

@Issues-translate-bot
Copy link

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
Copy link
Contributor

@i-square

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

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

@Issues-translate-bot
Copy link

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.

@R917C
Copy link
Author

R917C commented Jul 19, 2024

一会之前我更新到了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
Copy link

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.

@R917C
Copy link
Author

R917C commented Jul 19, 2024

一会之前我更新到了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
Copy link

@i-square

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

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

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

@Issues-translate-bot
Copy link

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?

@R917C
Copy link
Author

R917C commented Jul 27, 2024

关了,大部分问题解决了

@R917C R917C closed this as completed Jul 27, 2024
@Issues-translate-bot
Copy link

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


Shut it down and most of the problems are solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants