Merge pull request #4953 from open-webui/dev

fix: support list in json schema to pydantic
This commit is contained in:
Timothy Jaeryang Baek 2024-08-27 22:45:28 +02:00 committed by GitHub
commit f4df49e600
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,7 +83,7 @@ def json_schema_to_pydantic_type(json_schema: dict[str, Any]) -> Any:
return float
elif type_ == "boolean" or type_ == "bool":
return bool
elif type_ == "array":
elif type_ == "array" or type_ == "list":
items_schema = json_schema.get("items")
if items_schema:
item_type = json_schema_to_pydantic_type(items_schema)