Skip to content

Conversation

kawayiYokami
Copy link
Contributor

@kawayiYokami kawayiYokami commented Sep 19, 2025

动机

当前分段回复的第一条消息存在不必要的延迟,影响用户体验。

改动点

  • 修改 �strbot/core/pipeline/respond/stage.py。
  • 在发送循环中增加 if index > 0 判断,使第一条消息被立即发送。

兼容性

  • 这不是一个破坏性变更。

Sourcery 摘要

改进:

  • 通过仅在后续分段之间等待,消除多段响应中首个分段的初始延迟。
Original summary in English

Summary by Sourcery

Enhancements:

  • Remove initial delay for the first segment in multi-part responses by only awaiting between subsequent segments.

在分段回复的发送循环中,增加index > 0的判断,确保第一条消息被立即发送,后续消息才应用延迟,以优化用户体验。
@auto-assign auto-assign bot requested review from Soulter and anka-afk September 19, 2025 18:32
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大家好 - 我已经审阅了您的更改,它们看起来很棒!


Sourcery 对开源项目免费 - 如果您喜欢我们的评论,请考虑分享它们 ✨
帮助我更有用!请在每条评论上点击 👍 或 👎,我将使用这些反馈来改进您的评论。
Original comment in English

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@anka-afk anka-afk removed their request for review September 20, 2025 13:42
@Soulter
Copy link
Member

Soulter commented Sep 21, 2025

之前增加首次发送延迟是为了模拟人发送消息时的效果,这也是分段回复的作用之一吧

@kawayiYokami
Copy link
Contributor Author

之前增加首次发送延迟是为了模拟人发送消息时的效果,这也是分段回复的作用之一吧

LLM调用本身就会用时间,所以首段延迟是没必要的。

比如调用5秒,等待3秒,发送第一段,等待3秒,发送第二段

改完之后是,调用5秒,发送第一段,等待3秒,发送第二段

第一段完全没必要等待,反而会导致延迟极大。
如果不是LLM回答,光速返回的时候也会造成首发延迟,我觉得很没有必要。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants