部分类型注解修复,优化import顺序,删除无用API文件
This commit is contained in:
@@ -32,10 +32,10 @@ class BaseAction(ABC):
|
||||
reasoning: str,
|
||||
cycle_timers: dict,
|
||||
thinking_id: str,
|
||||
chat_stream: ChatStream = None,
|
||||
chat_stream: ChatStream,
|
||||
log_prefix: str = "",
|
||||
shutting_down: bool = False,
|
||||
plugin_config: dict = None,
|
||||
plugin_config: Optional[dict] = None,
|
||||
**kwargs,
|
||||
):
|
||||
"""初始化Action组件
|
||||
|
||||
@@ -29,7 +29,7 @@ class BaseCommand(ABC):
|
||||
command_examples: List[str] = []
|
||||
intercept_message: bool = True # 默认拦截消息,不继续处理
|
||||
|
||||
def __init__(self, message: MessageRecv, plugin_config: dict = None):
|
||||
def __init__(self, message: MessageRecv, plugin_config: Optional[dict] = None):
|
||||
"""初始化Command组件
|
||||
|
||||
Args:
|
||||
|
||||
@@ -66,7 +66,7 @@ class BasePlugin(ABC):
|
||||
|
||||
config_section_descriptions: Dict[str, str] = {}
|
||||
|
||||
def __init__(self, plugin_dir: str = None):
|
||||
def __init__(self, plugin_dir: str):
|
||||
"""初始化插件
|
||||
|
||||
Args:
|
||||
@@ -526,7 +526,7 @@ class BasePlugin(ABC):
|
||||
|
||||
# 从配置中更新 enable_plugin
|
||||
if "plugin" in self.config and "enabled" in self.config["plugin"]:
|
||||
self.enable_plugin = self.config["plugin"]["enabled"]
|
||||
self.enable_plugin = self.config["plugin"]["enabled"] # type: ignore
|
||||
logger.debug(f"{self.log_prefix} 从配置更新插件启用状态: {self.enable_plugin}")
|
||||
else:
|
||||
logger.warning(f"{self.log_prefix} 不支持的配置文件格式: {file_ext},仅支持 .toml")
|
||||
|
||||
@@ -81,7 +81,9 @@ class ComponentInfo:
|
||||
class ActionInfo(ComponentInfo):
|
||||
"""动作组件信息"""
|
||||
|
||||
action_parameters: Dict[str, str] = field(default_factory=dict) # 动作参数与描述,例如 {"param1": "描述1", "param2": "描述2"}
|
||||
action_parameters: Dict[str, str] = field(
|
||||
default_factory=dict
|
||||
) # 动作参数与描述,例如 {"param1": "描述1", "param2": "描述2"}
|
||||
action_require: List[str] = field(default_factory=list) # 动作需求说明
|
||||
associated_types: List[str] = field(default_factory=list) # 关联的消息类型
|
||||
# 激活类型相关
|
||||
|
||||
Reference in New Issue
Block a user