重构并增强Napcat适配器的功能
- 更新了`BaseAdapter`以简化子进程处理。 - 对`AdapterManager`进行了重构,以便根据适配器的`run_in_subprocess`属性来管理适配器。 - 增强了`NapcatAdapter`,以利用新的`CoreSinkManager`实现更优的进程管理。 - 在`utils.py`中实现了针对群组和成员信息的缓存机制。 - 改进了`message_handler.py`中的消息处理,以支持各种消息类型和格式。 - 已将插件配置版本更新至7.8.3。
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import asyncio
|
||||
import time
|
||||
import traceback
|
||||
from typing import Any
|
||||
from typing import Any, TYPE_CHECKING
|
||||
|
||||
from src.chat.message_receive.chat_stream import ChatStream, get_chat_manager
|
||||
from src.chat.message_receive.chat_stream import get_chat_manager
|
||||
from src.chat.utils.timer_calculator import Timer
|
||||
from src.common.data_models.database_data_model import DatabaseMessages
|
||||
from src.common.logger import get_logger
|
||||
@@ -14,6 +14,9 @@ from src.plugin_system.base.base_action import BaseAction
|
||||
from src.plugin_system.base.component_types import ActionInfo, ComponentType
|
||||
from src.plugin_system.core.component_registry import component_registry
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from src.chat.message_receive.chat_stream import ChatStream
|
||||
|
||||
logger = get_logger("action_manager")
|
||||
|
||||
|
||||
@@ -48,7 +51,7 @@ class ChatterActionManager:
|
||||
reasoning: str,
|
||||
cycle_timers: dict,
|
||||
thinking_id: str,
|
||||
chat_stream: ChatStream,
|
||||
chat_stream: "ChatStream",
|
||||
log_prefix: str,
|
||||
shutting_down: bool = False,
|
||||
action_message: DatabaseMessages | None = None,
|
||||
@@ -476,7 +479,7 @@ class ChatterActionManager:
|
||||
|
||||
async def _send_and_store_reply(
|
||||
self,
|
||||
chat_stream: ChatStream,
|
||||
chat_stream: "ChatStream",
|
||||
response_set,
|
||||
loop_start_time,
|
||||
action_message,
|
||||
|
||||
Reference in New Issue
Block a user