重构ChatStream和StreamContext:移除context_manager引用

- 在ChatStream及相关类中,将所有context_manager的实例替换为直接上下文访问。
- 更新方法,利用新的上下文结构来管理聊天状态和消息。
- 增强的StreamContext,增加了用于消息处理、统计和历史管理的方法。
- 在重构过程中改进了错误处理和日志记录。
This commit is contained in:
Windpicker-owo
2025-11-25 12:01:26 +08:00
parent d30b0544b5
commit 1ebdc37b22
16 changed files with 487 additions and 753 deletions

View File

@@ -54,7 +54,7 @@ class TTSAction(BaseAction):
success, response_set, _ = await generate_reply(
chat_stream=self.chat_stream,
reply_message=self.chat_stream.context_manager.context.get_last_message(),
reply_message=self.chat_stream.context.get_last_message(),
enable_tool=global_config.tool.enable_tool,
request_type="chat.tts",
from_plugin=False,