Skip to content

有关流式输出 #7379

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

Open
deeeiznc opened this issue Apr 11, 2025 · 5 comments
Open

有关流式输出 #7379

deeeiznc opened this issue Apr 11, 2025 · 5 comments
Labels
🐛 Bug Something isn't working | 缺陷 unconfirm 未被维护者确认的问题

Comments

@deeeiznc
Copy link

📦 部署环境

Docker

📦 部署模式

服务端模式(lobe-chat-database 镜像)

📌 软件版本

v1.79.7

💻 系统环境

macOS

🌐 浏览器

Chrome

🐛 问题描述

问题

若 uni-api 中的 Google 系列模型思考时间过长,会导致如图错误,比如我使用 uni-api 中的 gemini-2.5-pro-exp-03-25 模型,发送了 Prompt(具体见复现步骤),

Image

查看 uni-api 日志发现 uni-api 运行正常, 且发现 lobechat 提交的请求是非流式的,故我用 curl 非流式请求 uni-api 同一个问题,结果正常输出,是 lobechat 的问题。

相关的问题

希望能实现第三方 Custom AI Provider 中每个模型的具体配置与官方模型的配置同步:对于第三方 Custom AI Provider 中的很多模型(比如 Google 系列),功能(Support)不能与官方同步,而联网功能自己是无法开启的(没有这个选项框),如下图所示

Image

📷 复现步骤

我发送的 Prompt with gemini-2.5-pro-exp-03-25

$\Delta u + b_i u_i = f$, $b_i, f \in C^1\left(\overline{\Omega}\right)$. Prove: $\exists C_0 \sim n,b,f$, s.t. $\sup_{\Omega'} |Du| \le \frac{C_0}{d} \left(1 + \sup_{\overline{\Omega}} u^2 \right)$. (hint: $P := \xi^2 |Du|^2 + \alpha u^2 + e^{\beta x_1}$).

🚦 期望结果

对于问题

  1. 功能实现:首先加一个全局开关流式和非流式的按钮,意思就是除非模型本身有限制,默认就按用户的选择发送请求;其次对于每个对话,在下图的位置加一个开关流式输出的按钮,从而实现局部临时的灵活配置。
Image
  1. 修复 bug:非流式输出,若 thinking 模型思考时间过长,API 能正常给出回复,但 lobechat 收不到,然后报错

对于相关的问题

希望能实现第三方 Custom AI Provider 中每个模型的具体配置与官方模型的配置同步

📝 补充信息

No response

@deeeiznc deeeiznc added the unconfirm 未被维护者确认的问题 label Apr 11, 2025
@lobehubbot
Copy link
Member

👀 @deeeiznc

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

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

dosubot bot commented Apr 11, 2025

Hello @deeeiznc! I'm here to help you with any bugs or questions you might have as you wait for a human maintainer. Feel free to ask me anything!

To address the issues you're experiencing with Lobe Chat, here are some suggestions:

  1. Streaming and Non-Streaming Toggle: Implementing a global toggle for streaming and non-streaming requests can be beneficial. This would allow users to choose their preferred request type unless the model itself imposes restrictions. Additionally, adding a toggle for streaming output at the conversation level can provide more flexibility for temporary configurations. Unfortunately, I couldn't find specific steps for adding such toggles in the UI within the repository, but this feature could be considered for future updates.

  2. Handling Long Response Times: If the Google series models in the uni-api are taking too long to respond, resulting in errors, consider deploying Lobe Chat using Docker instead of Vercel. Docker does not have the timeout limitations that Vercel does, which can help prevent interruptions during long inference processes [1].

  3. Synchronizing Configurations: Synchronizing configurations between third-party Custom AI Providers and official models is a feature that users have requested. However, I couldn't find specific information on how Lobe Chat currently handles this synchronization. It might be worth exploring this feature in future updates to ensure that third-party models can support functionalities similar to official models.

These suggestions aim to improve the flexibility and reliability of Lobe Chat when dealing with different AI models and configurations.

To continue talking to Dosu, mention @dosu.


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

@Kryo123456
Copy link

同求,gemini的模型使用流式输出很容易出现中断的情况。

@lobehubbot
Copy link
Member

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


Together, gemini's model uses streaming output and is prone to interruption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷 unconfirm 未被维护者确认的问题
Projects
Status: Roadmap - Chat 1.x
Development

No branches or pull requests

4 participants
@Kryo123456 @deeeiznc @lobehubbot and others