[Bugfix] Followup to #59299: preserve Unicode in structured decision state prompts (#60651)

Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
Co-authored-by: Misha Goin <mgoin64@gmail.com>
This commit is contained in:
Francisco Javier Arceo
2026-10-08 11:00:03 -07:00
committed by GitHub
co-authored by Misha Goin
parent 242e4213fc
commit 705e124c05
2 changed files with 7 additions and 1 deletions
@@ -10,6 +10,7 @@ from vllm.entrypoints.generate.structured_decisions.api_router import (
register_structured_decisions_api_router,
)
from vllm.entrypoints.generate.structured_decisions.question_types import LABELS
from vllm.entrypoints.generate.structured_decisions.serving import state_text
from vllm.entrypoints.generate.structured_decisions.strategies import (
NextTokenStrategy,
reply_label_ids,
@@ -40,6 +41,11 @@ def test_route_needs_the_flag():
assert ("/v1/systemone" in paths) == enabled
def test_structured_state_keeps_unicode_in_prompt():
state = {"message": "Français 日本語"}
assert state_text(state) == '{"message": "Français 日本語"}'
@pytest.fixture(scope="module")
def qwen():
from transformers import AutoTokenizer
@@ -25,7 +25,7 @@ logger = init_logger(__name__)
def state_text(state: Any) -> str:
return state if isinstance(state, str) else json.dumps(state)
return state if isinstance(state, str) else json.dumps(state, ensure_ascii=False)
def parse_questions(