ant-design / pro-chat

🤖 Components Library for Quickly Building LLM Chat Interfaces.
https://pro-chat.antdigital.dev
MIT License
582 stars 71 forks source link

🧐[问题]流式输出感觉很卡顿 #121

Open lolocoo opened 4 months ago

lolocoo commented 4 months ago

🧐 问题描述

流式输出ui展示感觉不是很流畅,感觉一卡一卡的。

💻 示例代码

🚑 其他信息

ONLY-yours commented 4 months ago

新版本已经优化过一版本了,现在应该很平滑?你是什么版本的呢?

FrancisKong commented 4 months ago

我也遇到同样问题,版本是 1.10.2,开发模式输出时会出现下面的警告信息:

Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.

警告定位到这一行代码

animationTimeoutId = setTimeout(updateText, 16); // 16 毫秒的延迟模拟打字机效果
ONLY-yours commented 4 months ago

试试1.10.3? waring还在么?

FrancisKong commented 4 months ago

错误还在,发送按钮的 loading 动画也很卡顿

ONLY-yours commented 4 months ago

错误还在,发送按钮的 loading 动画也很卡顿

能在给点详细信息么?

我在 React 18、NextJs14下,浏览器的话 Edge 和 Chrome 都没有复现这个问题

liguobao commented 4 months ago

我也遇到同样问题,版本是 1.10.2,开发模式输出时会出现下面的警告信息:

Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.

警告定位到这一行代码

animationTimeoutId = setTimeout(updateText, 16); // 16 毫秒的延迟模拟打字机效果

这个错误我这边也会发生,不过卡顿程度来说倒还好。

同时Loading 自动听下来效果不间断失效,已确定服务端返回了 DONE消息。

ONLY-yours commented 3 months ago

同时Loading 自动听下来效果不间断失效,已确定服务端返回了 DONE消息。

不间断失效的问题在 1.11.0 版本中一并修复了,现在还会出现么

liguobao commented 3 months ago

我再确认一下~

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: Shinji-Li @.> 发送时间: 2024年3月15日 17:50 收件人: ant-design/pro-chat @.> 抄送: 李国宝 @.>, Comment @.> 主题: Re: [ant-design/pro-chat] ��[问题]流式输出感觉很卡顿 (Issue #121)

同时Loading 自动听下来效果不间断失效,已确定服务端返回了 DONE消息。

不间断失效的问题在 1.11.0 版本中一并修复了,现在还会出现么

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

FrancisKong commented 3 months ago

错误还在,发送按钮的 loading 动画也很卡顿

能在给点详细信息么?

我在 React 18、NextJs14下,浏览器的话 Edge 和 Chrome 都没有复现这个问题

我测试了下,第一轮对话的时候是没问题的,但当对话的轮次多时就变卡了。 升级了新版本 1.11.0 还存在这个问题

liguobao commented 3 months ago

错误还在,发送按钮的 loading 动画也很卡顿

能在给点详细信息么? 我在 React 18、NextJs14下,浏览器的话 Edge 和 Chrome 都没有复现这个问题

我测试了下,第一轮对话的时候是没问题的,但当对话的轮次多时就变卡了。 升级了新版本 1.11.0 还存在这个问题

大概是5次左右对吧?

misakayao commented 3 months ago

使用1.11.0也遇到了,使用ReadableStream封装了流式返回,controller.enqueue多次控制台就会显示Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.

liguobao commented 3 months ago

升级到1.12.1依旧还是这个问题

Feahter commented 12 hours ago

1.15.1的版本 侧边栏模式,只要对话出现滚动条,SSE流式对话依旧会出现不稳定的跳动,可能是高度重置函数过于频繁导致,重置函数可以尝试节流。

misakayao commented 12 hours ago

您的邮件我已收到,感谢您的来信!