[Bugfix][v1] xgrammar structured output supports Enum. (#15594)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
This commit is contained in:
Chauncey
2025-03-28 06:14:53 -07:00
committed by GitHub
parent 91276c5721
commit 3b00ff9138
2 changed files with 53 additions and 4 deletions
-4
View File
@@ -26,10 +26,6 @@ def has_xgrammar_unsupported_json_features(schema: dict[str, Any]) -> 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