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 没有实时流式输出,响应很慢 #5161

Open
hjkcai opened this issue Dec 23, 2024 · 3 comments
Open

[Bug] Gemini 没有实时流式输出,响应很慢 #5161

hjkcai opened this issue Dec 23, 2024 · 3 comments
Labels
🐛 Bug Something isn't working | 缺陷

Comments

@hjkcai
Copy link

hjkcai commented Dec 23, 2024

📦 部署环境

Docker

📌 软件版本

1.39.0

💻 系统环境

Android

🌐 浏览器

Chrome

🐛 问题描述

如题。Lobe 的后端请求 Gemini 接口得到流式结果,后端要等到所有 chunk 全部输出完毕后才会一次性推送到前端。到了前端以后还要等待动画加载完成,因为动画过程中无法阅读,所以整体等待时间非常长。

📷 复现步骤

打开 DEBUG_GOOGLE_CHAT_COMPLETION 很容易可以观察到

录屏:

Screenrecorder-2024-12-24-06-54-19-620.mp4

🚦 期望结果

希望可以获得实时流式输出

📝 补充信息

No response

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

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


📦 Deployment environment

Docker

📌 Software version

1.39.0

💻 System environment

Android

🌐 Browser

Chrome

🐛 Problem description

As title. Lobe's backend requests the Gemini interface to get streaming results. The backend waits until all chunks are output before pushing them to the frontend at once. After arriving at the front end, you still have to wait for the animation to be loaded. Because you cannot read during the animation, the overall waiting time is very long.

📷 Steps to reproduce

Turning on DEBUG_GOOGLE_CHAT_COMPLETION can easily be observed

Screen recording:

Screenrecorder-2024-12-24-06-54-19-620.mp4

🚦 Expected results

Would love to get live streaming output

📝 Supplementary information

No response

@lobehubbot
Copy link
Member

👀 @hjkcai

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

Copy link

dosubot bot commented Dec 23, 2024

@hjkcai 你好!我是Dosu,一个可以帮你解决 bug、回答问题和成为贡献者的机器人。我会在这里帮助你,等待人类维护者的到来。加油!🤖

The issue you're experiencing with the Gemini interface not providing real-time streaming output is due to the fact that the Gemini 1.5 Pro model does not support streaming capabilities. This results in slower response times as the model processes and returns data in chunks rather than a continuous stream [1].

Additionally, the Lobe Chat frontend uses a typewriter effect to display responses, which can further delay the ability to read the output as it waits for all chunks to be processed before displaying them [2][3].

Unfortunately, there are no configuration options or flags in the Lobe Chat codebase that can enable or simulate real-time streaming for models that do not natively support it [4].

To continue talking to Dosu, mention @dosu.


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

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
Status: Roadmap - Chat 1.x
Development

No branches or pull requests

2 participants