From 4a24bc8c219c98e9e022647d636dde239ccc2da8 Mon Sep 17 00:00:00 2001 From: CGD <3030332422@qq.com> Date: Thu, 26 Jun 2025 17:37:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=84=E7=90=86config=5Ffunctions?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E5=9E=8B=E8=BD=AC=E6=8D=A2=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E5=88=9D=E5=A7=8B=E5=8C=96=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/providers/tools/server_plugins/plugin_executor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main/xiaozhi-server/core/providers/tools/server_plugins/plugin_executor.py b/main/xiaozhi-server/core/providers/tools/server_plugins/plugin_executor.py index e9194e5a..728493ec 100644 --- a/main/xiaozhi-server/core/providers/tools/server_plugins/plugin_executor.py +++ b/main/xiaozhi-server/core/providers/tools/server_plugins/plugin_executor.py @@ -57,6 +57,13 @@ class ServerPluginExecutor(ToolExecutor): config_functions = self.config["Intent"][ self.config["selected_module"]["Intent"] ].get("functions", []) + + # 转换为列表 + if not isinstance(config_functions, list): + try: + config_functions = list(config_functions) + except TypeError: + config_functions = [] # 合并所有需要的函数 all_required_functions = list(set(necessary_functions + config_functions))