We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c0812f9 commit 1298875Copy full SHA for 1298875
autogen/function_utils.py
@@ -353,4 +353,4 @@ def serialize_to_str(x: Any) -> str:
353
elif isinstance(x, BaseModel):
354
return model_dump_json(x)
355
else:
356
- return json.dumps(x)
+ return json.dumps(x, ensure_ascii=False)
test/test_function_utils.py
@@ -391,6 +391,10 @@ async def f(
391
assert actual[1] == "EUR"
392
393
394
+def test_serialize_to_str_with_nonascii() -> None:
395
+ assert serialize_to_str("中文") == "中文"
396
+
397
398
def test_serialize_to_json() -> None:
399
assert serialize_to_str("abc") == "abc"
400
assert serialize_to_str(123) == "123"
0 commit comments