Add outlines fallback when JSON schema has enum (#13449)
Signed-off-by: mgoin <mgoin64@gmail.com>
This commit is contained in:
@@ -14,6 +14,10 @@ def has_xgrammar_unsupported_json_features(schema: dict) -> bool:
|
||||
if "pattern" in obj:
|
||||
return True
|
||||
|
||||
# Check for enum restrictions
|
||||
if "enum" in obj:
|
||||
return True
|
||||
|
||||
# Check for numeric ranges
|
||||
if obj.get("type") in ("integer", "number") and any(
|
||||
key in obj for key in [
|
||||
|
||||
Reference in New Issue
Block a user