From f29280ba5c4be690d34a797cd3a0f552fffcad4f Mon Sep 17 00:00:00 2001 From: Yeuoly <45712896+Yeuoly@users.noreply.github.com> Date: Fri, 15 Mar 2024 11:44:24 +0800 Subject: [PATCH] Fix/compatible to old tool config (#2839) --- api/controllers/console/app/model_config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/controllers/console/app/model_config.py b/api/controllers/console/app/model_config.py index 436f8c1447810b..2095bb6bea4c2f 100644 --- a/api/controllers/console/app/model_config.py +++ b/api/controllers/console/app/model_config.py @@ -52,6 +52,9 @@ def post(self, app_id): masked_parameter_map = {} tool_map = {} 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: