mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-01 10:48:37 +08:00
add support for swagger object type (#3426)
Co-authored-by: lipeikui <lipeikui@3vjia.com>
This commit is contained in:
parent
066076b157
commit
38ca3b29b5
@ -291,6 +291,16 @@ class ApiTool(Tool):
|
||||
elif property['type'] == 'null':
|
||||
if value is None:
|
||||
return None
|
||||
elif property['type'] == 'object':
|
||||
if isinstance(value, str):
|
||||
try:
|
||||
return json.loads(value)
|
||||
except ValueError:
|
||||
return value
|
||||
elif isinstance(value, dict):
|
||||
return value
|
||||
else:
|
||||
return value
|
||||
else:
|
||||
raise ValueError(f"Invalid type {property['type']} for property {property}")
|
||||
elif 'anyOf' in property and isinstance(property['anyOf'], list):
|
||||
|
Loading…
Reference in New Issue
Block a user