ruff: 清理代码并规范导入顺序
对整个代码库进行了大规模的清理和重构,主要包括: - 统一并修复了多个文件中的 `import` 语句顺序,使其符合 PEP 8 规范。 - 移除了大量未使用的导入和变量,减少了代码冗余。 - 修复了多处代码风格问题,例如多余的空行、不一致的引号使用等。 - 简化了异常处理逻辑,移除了不必要的 `noqa` 注释。 - 在多个文件中使用了更现代的类型注解语法(例如 `list[str]` 替代 `List[str]`)。
This commit is contained in:
@@ -279,7 +279,7 @@ class ToolExecutor:
|
||||
logger.info(
|
||||
f"{self.log_prefix} 正在执行工具: [bold green]{function_name}[/bold green] | 参数: {function_args}"
|
||||
)
|
||||
|
||||
|
||||
# 检查是否是MCP工具
|
||||
try:
|
||||
from src.plugin_system.utils.mcp_tool_provider import mcp_tool_provider
|
||||
@@ -295,7 +295,7 @@ class ToolExecutor:
|
||||
}
|
||||
except Exception as e:
|
||||
logger.debug(f"检查MCP工具时出错: {e}")
|
||||
|
||||
|
||||
function_args["llm_called"] = True # 标记为LLM调用
|
||||
|
||||
# 检查是否是二步工具的第二步调用
|
||||
|
||||
Reference in New Issue
Block a user