Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: A problem found in the autogen.function_utils method #2511

Closed
znjt opened this issue Apr 25, 2024 · 2 comments · Fixed by #2714
Closed

[Bug]: A problem found in the autogen.function_utils method #2511

znjt opened this issue Apr 25, 2024 · 2 comments · Fixed by #2714
Labels
code-execution execute generated code

Comments

@znjt
Copy link

znjt commented Apr 25, 2024

Describe the bug

function_utils.autogen. serialize_to_str(x: Any) -> str, if the parameter is list Chinese string, in the case of x meets Chinese, it will go to json.dumps(x), at this time, it will appear that the parameter x is ascii, instead of the original parameter value. For example, if x:["中文"], it will return: '["\\u4e2d\\u6587"]''
solution:json.dumps(x)->json.dumps(x,ensure_ascii=False)

Steps to reproduce

No response

Model Used

No response

Expected Behavior

No response

Screenshots and logs

No response

Additional Information

No response

@znjt znjt added the bug label Apr 25, 2024
@ekzhu
Copy link
Collaborator

ekzhu commented Apr 25, 2024

Thanks for the issue. Can you submit a PR with your fix and add a unit test case for this?

@jtoy
Copy link
Contributor

jtoy commented May 17, 2024

@znjt @ekzhu I have submitted a PR with tests for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-execution execute generated code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants