ruff fix但指定了--unsafe-fixes
This commit is contained in:
@@ -835,8 +835,6 @@ class ComponentRegistry:
|
||||
},
|
||||
"enabled_components": len([c for c in self._components.values() if c.enabled]),
|
||||
"enabled_plugins": len([p for p in self._plugins.values() if p.enabled]),
|
||||
"enabled_components": len([c for c in self._components.values() if c.enabled]),
|
||||
"enabled_plugins": len([p for p in self._plugins.values() if p.enabled]),
|
||||
}
|
||||
|
||||
# === 组件移除相关 ===
|
||||
|
||||
@@ -46,8 +46,8 @@ class EventManager:
|
||||
def register_event(
|
||||
self,
|
||||
event_name: EventType | str,
|
||||
allowed_subscribers: list[str] = None,
|
||||
allowed_triggers: list[str] = None,
|
||||
allowed_subscribers: list[str] | None = None,
|
||||
allowed_triggers: list[str] | None = None,
|
||||
) -> bool:
|
||||
"""注册一个新的事件
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ class ToolExecutor:
|
||||
pending_step_two = getattr(self, "_pending_step_two_tools", {})
|
||||
if pending_step_two:
|
||||
# 添加第二步工具定义
|
||||
for tool_name, step_two_def in pending_step_two.items():
|
||||
for step_two_def in pending_step_two.values():
|
||||
tool_definitions.append(step_two_def)
|
||||
|
||||
return tool_definitions
|
||||
@@ -192,7 +192,7 @@ class ToolExecutor:
|
||||
"timestamp": time.time(),
|
||||
}
|
||||
content = tool_info["content"]
|
||||
if not isinstance(content, (str, list, tuple)):
|
||||
if not isinstance(content, str | list | tuple):
|
||||
tool_info["content"] = str(content)
|
||||
|
||||
tool_results.append(tool_info)
|
||||
|
||||
Reference in New Issue
Block a user