Fix/compatible to old tool config (#2839)

This commit is contained in:
Yeuoly 2024-03-15 11:44:24 +08:00 committed by GitHub
parent 742be06ea9
commit f29280ba5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: