Skip to content

[Feature Request] Allow Configuration of ensure_ascii for JSON Serialization to Support Non-ASCII Characters #3139

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

Open
Magma3X opened this issue May 9, 2025 · 5 comments
Labels
enhancement New feature or request

Comments

@Magma3X
Copy link

Magma3X commented May 9, 2025

Problem Description

I'm working with agno in french and I frequently encounter encoding issues with the model response. As an exemple, I get " l'ann\u0000e9e " instead of " l'année ". After some digging, I think the issue is related to the json library functions.

Proposed Solution

I think the option to choose the ensure_ascii parameter should be given at agent creation. This would improve the quality of results with languages that use characters outside the ascii table, such as french.

Alternatives Considered

Additional context

I had similar issues with other tools I use, which I fixed by adding ensure_ascii=False as an additional parameter for the json functions
Exemple : json.dumps(text) to json.dumps(text, ensure_ascii=False)

Would you like to work on this?

We welcome contributions! Let us know if you’d like to help implement this feature.
[ ] Yes, I’d love to work on it!
[ ] I’m open to collaborating but need guidance.
[X] No, I’m just sharing the idea.

@Magma3X Magma3X added the enhancement New feature or request label May 9, 2025
@monali7-d monali7-d moved this to Feature Requests in Agno Roadmap May 12, 2025
@monali7-d
Copy link
Contributor

Hey there! 😊

Thank you so much for reaching out and for your support for Agno — it truly means a lot to us. We’ve added your suggestion to our roadmap! Since Agno is open source, you’re more than welcome to take a stab at it yourself — and we’d be more than happy to support you along the way.

Looking forward to building together!

@KinonoChen
Copy link
Contributor

这个问题我在某个方法里修复过,也提交了pr,但是貌似有太多地方需要修改ensure_ascii=False

@lironesamoun
Copy link
Contributor

hi @KinonoChen , I don't see your PR ?

@Eimis
Copy link

Eimis commented May 15, 2025

@monali7-d why was this closed as completed? As far as I understand, it's not yet possible to make sure the the non-ASCII characters are embedded properly?

Example of my embeddings is here. The Lithuanian characters ą, č, ę, ė, į etc. are escaped in the "content" column for embeddings.

{"Pavard\u0117": "Aglinskas", "Vardas": "Vincas", "T\u0117vo vardas": "juozo", "Slapyvardis": null, "Teritorija": "Vytauto", "Gimimo metai": "1920", "Mirties data": "1944-11-20 (22)", "Mirties vieta": "Roki\u0161kio aps. Kamaj\u0173 vls. Mikni\u016bn\u0173 k.", "Pastabos": null}

@dirkbrnd dirkbrnd reopened this May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Feature Requests
Development

No branches or pull requests

6 participants