[Feature][V1] Add xgrammar to support minLength, maxLength with test (#16516)

Signed-off-by: Leon Seidel <leon.seidel@fau.de>
This commit is contained in:
leon-seidel
2025-04-12 08:22:07 +02:00
committed by GitHub
parent bd6028d6b0
commit e92d7085bf
3 changed files with 48 additions and 10 deletions

View File

@@ -41,8 +41,7 @@ def has_xgrammar_unsupported_json_features(schema: dict[str, Any]) -> bool:
return True
# Unsupported keywords for strings
if obj.get("type") == "string" and any(
key in obj for key in ("minLength", "maxLength", "format")):
if obj.get("type") == "string" and "format" in obj:
return True
# Unsupported keywords for objects