Skip to content

Fix: Ensure AssistantMessage is saved in memory for streamed text-only #15

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kylesean
Copy link

chatStreamed() 中构建 $generatorSendMessage 的条件判断似乎不严谨,我用 redis 驱动记忆,测试流式响应的时候发现如果让大模型不调用工具,只输出文本内容,会导致 $generatorSendMessagenull
修改后的条件判断确保只要模型通过流式响应输出了任何文本内容(即使没有工具调用),chatStreamed 都会构建AssistantMessage 并添加到记忆中。

@kylesean kylesean changed the title Fix: Ensure AssistantMessage is saved in memory for streamed text-onl… Fix: Ensure AssistantMessage is saved in memory for streamed text-only Jun 21, 2025
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.

1 participant