소스 검색

Fix/compatible to old tool config (#2839)

Yeuoly 1 년 전
부모
커밋
f29280ba5c
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      api/controllers/console/app/model_config.py

+ 3 - 0
api/controllers/console/app/model_config.py

@@ -52,6 +52,9 @@ class ModelConfigResource(Resource):
         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: