We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efb775b commit 2efa54aCopy full SHA for 2efa54a
ollama/_utils.py
@@ -63,8 +63,7 @@ def _get_json_type(python_type: Any) -> str | List[str]:
63
if is_union(python_type):
64
args = get_args(python_type)
65
# Filter out None/NoneType from union args
66
- non_none_args = [arg for arg in args if arg not in (None, type(None))]
67
- if non_none_args:
+ if non_none_args := [arg for arg in args if arg not in (None, type(None))]:
68
if len(non_none_args) == 1:
69
return _get_json_type(non_none_args[0])
70
# For multiple types (e.g., int | str | None), return array of types
0 commit comments