Skip to content

Commit

Permalink
bugfix: exclude null types in anyOf list
Browse files Browse the repository at this point in the history
  • Loading branch information
leloykun committed May 20, 2024
1 parent edf0320 commit dbf193e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion outlines/fsm/json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def optimize_schema(instance):
elif "anyOf" in subinstance and _has_null_type(subinstance["anyOf"]):
any_of_list = subinstance.pop("anyOf")
filtered_any_of_list = list(
filter(lambda d: _is_null_type(d), any_of_list)
filter(lambda d: not _is_null_type(d), any_of_list)
)
if len(filtered_any_of_list) == 0:
keys_to_remove.add(key)
Expand Down

0 comments on commit dbf193e

Please sign in to comment.