fix: compatible to old tool config (#2837)

This commit is contained in:
Yeuoly 2024-03-14 17:51:11 +08:00 committed by GitHub
parent 19d3a56194
commit bbea3a6b84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -245,6 +245,8 @@ class AppApi(Resource):
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: