From 37f7b43d6eaf37cf1edeeaf3db3c45a7df26d7c3 Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Thu, 26 Mar 2026 21:02:02 +0800 Subject: [PATCH] fix(tool): add list_tools() method to ToolSet Commit 292199dc renamed tools.func_list -> tools.list_tools() in openai_source.py but forgot to add the list_tools() method to the ToolSet class, causing AttributeError at runtime. --- astrbot/core/agent/tool.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/astrbot/core/agent/tool.py b/astrbot/core/agent/tool.py index 82a612fba..55ec7d600 100644 --- a/astrbot/core/agent/tool.py +++ b/astrbot/core/agent/tool.py @@ -216,6 +216,10 @@ class ToolSet: """Get the list of function tools.""" return self.tools + def list_tools(self) -> list[FunctionTool]: + """Get the list of function tools (alias for func_list).""" + return self.tools + def openai_schema(self, omit_empty_parameter_field: bool = False) -> list[dict]: """Convert tools to OpenAI API function calling schema format.""" result = []