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] Google Provider 前端模式不生效 #5399

Closed
Superzk1024 opened this issue Jan 11, 2025 · 10 comments · Fixed by #5498
Closed

[Bug] Google Provider 前端模式不生效 #5399

Superzk1024 opened this issue Jan 11, 2025 · 10 comments · Fixed by #5498
Labels
🐛 Bug Something isn't working | 缺陷 released

Comments

@Superzk1024
Copy link

📦 部署环境

Docker

📌 软件版本

1.45.3

💻 系统环境

Windows

🌐 浏览器

Chrome

🐛 问题描述

Google 服务商在配置的时候设置的是前端模式并且检查通过,但是实际请求的时候却不是对应的配置地址

image

错误如图:

image

📷 复现步骤

正常配置好服务商之后进入聊天进行提问就会出现

🚦 期望结果

能正确进行前端请求

📝 补充信息

不正常的时候 Ctrl +F5 刷新能正常,但是在正常的时候 Ctrl +F5 刷新反而也会变得不正常

@Superzk1024 Superzk1024 added the 🐛 Bug Something isn't working | 缺陷 label Jan 11, 2025
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Jan 11, 2025
@lobehubbot
Copy link
Member

👀 @Superzk1024

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

@lobehubbot
Copy link
Member

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


📦 Deployment environment

Docker

📌 Software version

1.45.3

💻 System environment

Windows

🌐 Browser

Chrome

🐛 Problem description

The Google service provider set the front-end mode during configuration and passed the check, but the actual request was not the corresponding configuration address.

image

The error is as shown below:

image

📷 Steps to reproduce

After configuring the service provider normally, enter the chat to ask questions and it will appear.

🚦 Expected results

Can make front-end requests correctly

📝 Supplementary information

When it is abnormal, Ctrl +F5 refresh can work normally, but when it is normal, Ctrl +F5 refresh will also become abnormal

Copy link

dosubot bot commented Jan 11, 2025

The issue you're experiencing with the Google provider's front-end mode not being applied correctly could be related to several conditions in the configuration. Here are some potential reasons and solutions:

  1. Browser Request Settings: Ensure that the provider has not disabled browser requests. The disableBrowserRequest should be set to false, and defaultShowBrowserRequest should be true to allow front-end requests.

  2. Endpoint and API Key: Verify that the endpoint is correctly configured and not empty. The showEndpoint should be true, and isProviderEndpointNotEmpty should be true. Similarly, ensure that the API key is provided and valid, with showApiKey and isProviderApiKeyNotEmpty both set to true.

  3. Environment Variables: Check the environment variable NEXT_PUBLIC_SERVICE_MODE. If it's set to 'server', the application will use the back-end mode (ServerService) instead of the front-end mode (ClientService). Ensure it's not set to 'server' if you want to use the front-end mode [1][2].

  4. Cache and Refresh: The behavior you described with Ctrl + F5 suggests a caching issue. Ensure that the browser cache is cleared, or try using an incognito window to see if the issue persists.

  5. 471 Status Code: The 471 status code error is triggered by specific error types (OpenAIBizError and ProviderBizError). Investigate these errors further to understand why they are occurring [3].

By checking these configurations and settings, you should be able to resolve the issue with the front-end mode not being applied correctly.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Copy link

dosubot bot commented Jan 11, 2025

I found a similar closed issue titled "I can't log in" in the Lobe Chat repository, but no solution was found in the comments [1].

Regarding your issue with the Google provider's front-end mode not working as expected, there are a few things you might want to check:

  1. Configuration Settings: Ensure that the configuration for the Google provider is correctly set up in the src/config/modelProviders/google.ts file. This includes verifying the proxyUrl and other relevant settings [2].

  2. Error Handling: The 471 status code might be related to how errors are handled in the API requests. Lobe Chat uses a method to parse error messages and categorize them into specific error types. You might want to check if the error handling logic is correctly identifying and processing the error you're encountering [3].

  3. Configuration Refresh: If refreshing the page (Ctrl + F5) sometimes resolves the issue, it might be related to how configuration settings are managed and applied. Lobe Chat uses a function to listen for updates to plugin settings, which might affect the behavior of the Google provider [4].

These steps might help you diagnose and resolve the issue with the front-end mode for the Google provider.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@Superzk1024
Copy link
Author

Superzk1024 commented Jan 11, 2025

我又试了几下好像发现规律了,配置好之后直接进聊天是正常的,然后就普通 F5 刷新一下就不行了
别的服务商比如 openrouter 也是一样一刷新就从前端模式变成后端模式了

@lobehubbot
Copy link
Member

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


I tried a few more times and seemed to find a pattern. After configuring it, it was normal to enter the chat directly, but then just refresh it with normal F5 and it didn't work.

@arvinxx
Copy link
Contributor

arvinxx commented Jan 14, 2025

哦我知道了, 应该是个 bug,我修一下

@lobehubbot
Copy link
Member

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


Oh, I know, it's probably a bug, I'll fix it

@github-project-automation github-project-automation bot moved this from Roadmap - Chat 1.x to Done in Lobe Chat Routine Jan 17, 2025
@lobehubbot
Copy link
Member

@Superzk1024

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

@lobehubbot
Copy link
Member

🎉 This issue has been resolved in version 1.47.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷 released
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants