From bbea3a6b8447b87f0fffef0d5c1387285feb128a Mon Sep 17 00:00:00 2001 From: Yeuoly <45712896+Yeuoly@users.noreply.github.com> Date: Thu, 14 Mar 2024 17:51:11 +0800 Subject: [PATCH] fix: compatible to old tool config (#2837) --- api/controllers/console/app/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/controllers/console/app/app.py b/api/controllers/console/app/app.py index fb697b6418a042..ff974054155f22 100644 --- a/api/controllers/console/app/app.py +++ b/api/controllers/console/app/app.py @@ -245,6 +245,8 @@ def get(self, app_id): agent_mode = model_config.agent_mode_dict # decrypt agent tool parameters if it's secret-input for tool in agent_mode.get('tools') or []: + if not isinstance(tool, dict) or len(tool.keys()) <= 3: + continue agent_tool_entity = AgentToolEntity(**tool) # get tool try: