[Bugfix][V0] XGrammar structured output supports Enum (#15878)

Signed-off-by: Leon Seidel <leon.seidel@fau.de>
This commit is contained in:
leon-seidel
2025-04-08 00:38:25 +02:00
committed by GitHub
parent fad6e2538e
commit 24f1c01e0f
2 changed files with 43 additions and 4 deletions

View File

@@ -14,10 +14,6 @@ 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 [