mirror of
https://github.com/open-webui/open-webui
synced 2024-11-28 06:53:14 +00:00
fix: type_ == "literal"
This commit is contained in:
parent
0525dd2bb5
commit
45363a2abb
@ -102,7 +102,7 @@ def json_schema_to_pydantic_type(json_schema: dict[str, Any]) -> Any:
|
|||||||
return dict
|
return dict
|
||||||
elif type_ == "null":
|
elif type_ == "null":
|
||||||
return Optional[Any] # Use Optional[Any] for nullable fields
|
return Optional[Any] # Use Optional[Any] for nullable fields
|
||||||
elif type_ is "literal":
|
elif type_ == "literal":
|
||||||
return Literal[literal_eval(json_schema.get("enum"))]
|
return Literal[literal_eval(json_schema.get("enum"))]
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unsupported JSON schema type: {type_}")
|
raise ValueError(f"Unsupported JSON schema type: {type_}")
|
||||||
|
Loading…
Reference in New Issue
Block a user