From bb885d32a57c462f2dde23abb22dfeaa4b9af88f Mon Sep 17 00:00:00 2001 From: chaunceyjiang Date: Sun, 30 Mar 2025 02:06:46 +0000 Subject: [PATCH 1/2] [Misc] xgrammar structured output supports Enum. Signed-off-by: chaunceyjiang --- tests/v1/structured_output/test_utils.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/v1/structured_output/test_utils.py b/tests/v1/structured_output/test_utils.py index 3aa86cbec533..9be54d2260aa 100644 --- a/tests/v1/structured_output/test_utils.py +++ b/tests/v1/structured_output/test_utils.py @@ -13,10 +13,6 @@ def unsupported_string_schemas(): "type": "string", "pattern": "^[a-zA-Z]+$" }, - { - "type": "string", - "enum": ["active", "inactive", "pending"] - }, { "type": "string", "minLength": 1 From a1087e02b7d3c2fea2925385c0a1774cab57f05c Mon Sep 17 00:00:00 2001 From: chaunceyjiang Date: Sun, 30 Mar 2025 02:15:16 +0000 Subject: [PATCH 2/2] [Misc] xgrammar structured output supports Enum. Signed-off-by: chaunceyjiang --- tests/v1/structured_output/test_utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/v1/structured_output/test_utils.py b/tests/v1/structured_output/test_utils.py index 9be54d2260aa..554f38926269 100644 --- a/tests/v1/structured_output/test_utils.py +++ b/tests/v1/structured_output/test_utils.py @@ -160,6 +160,10 @@ def supported_schema(): "type": "number" } }, + "car_type": { + "type": "string", + "enum": ["sedan", "suv", "truck"] + }, "address": { "type": "object", "properties": {