better:给心流添加了自动停止和销毁,节省资源

This commit is contained in:
SengokuCola
2025-03-29 23:56:14 +08:00
parent b8828e81c6
commit 1641d89ca2
4 changed files with 52 additions and 45 deletions

View File

@@ -221,11 +221,8 @@ class ChatBot:
chat_talking_prompt = get_recent_group_detailed_plain_text(
stream_id, limit=global_config.MAX_CONTEXT_SIZE, combine=True
)
if heartflow.get_subheartflow(stream_id):
await heartflow.get_subheartflow(stream_id).do_after_reply(response_set, chat_talking_prompt)
else:
await heartflow.create_subheartflow(stream_id).do_after_reply(response_set, chat_talking_prompt)
heartflow.get_subheartflow(stream_id).do_after_reply(response_set, chat_talking_prompt)
async def _send_response_messages(self, message, chat, response_set, thinking_id):