refactor(chat): 统一异步调用模式并修复循环依赖

- 将 chat_manager.get_stream() 调用改为异步
- 将 replyer_manager.get_replyer() 方法改为异步
- 在 generator_api 中使用动态导入避免循环依赖
- 在 action_manager 中添加待处理动作队列清理
- 更新所有相关调用点以支持异步模式
This commit is contained in:
Windpicker-owo
2025-10-05 18:30:16 +08:00
parent 4cdc5fc89d
commit 3e37b7cef5
6 changed files with 18 additions and 14 deletions

View File

@@ -490,7 +490,7 @@ class Prompt:
from src.plugin_system.apis.generator_api import get_replyer
# 创建临时生成器实例来使用其方法
temp_generator = get_replyer(None, chat_id, request_type="prompt_building")
temp_generator = await get_replyer(None, chat_id, request_type="prompt_building")
return await temp_generator.build_s4u_chat_history_prompts(
message_list_before_now, target_user_id, sender, chat_id
)