From 4ff06e4335dd078fe1235993fe8ea432317fdceb Mon Sep 17 00:00:00 2001 From: coolmian <36444522+coolmian@users.noreply.github.com> Date: Mon, 11 Nov 2024 11:55:35 +0800 Subject: [PATCH] fix: prevent Chinese examples from being converted to Unicode encoding --- dspy/adapters/chat_adapter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspy/adapters/chat_adapter.py b/dspy/adapters/chat_adapter.py index 0b1740542d..edb5e18706 100644 --- a/dspy/adapters/chat_adapter.py +++ b/dspy/adapters/chat_adapter.py @@ -388,7 +388,7 @@ def field_metadata(field_name, field_info): desc = f"must be one of: {'; '.join([str(x) for x in type_.__args__])}" else: desc = "must be pareseable according to the following JSON schema: " - desc += json.dumps(prepare_schema(type_)) + desc += json.dumps(prepare_schema(type_), ensure_ascii=False) desc = (" " * 8) + f"# note: the value you produce {desc}" if desc else "" return f"{{{field_name}}}{desc}"