Encoding Support for Emojis in save_response_to_file Method for Makrdown · Issue #2690 · agno-agi/agno · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, I want to express my appreciation for your excellent library—I've been using it extensively in my product development, and it's been a great help!
However, I’ve encountered an issue when saving responses in markdown format that contain emojis. The file doesn't get saved due to an encoding issue when using the save_response_to_file method.
The issue seems to stem from the encoding used when writing the response content to the file. The problem was resolved on my end when I modified this line: fn_path.write_text(self.run_response.content) to fn_path.write_text(self.run_response.content, encoding="utf-8")
After adding UTF-8 encoding, the emojis were saved correctly. I would like to suggest that you consider providing built-in support for encoding options in the save_response_to_file method, as this would resolve the issue for all users who deal with non-ASCII characters such as emojis.
Thank you for your consideration, and I look forward to any updates or fixes to address this
Note: Also let me know in case you guys want me to raise the pull request with this fix, though this is small.
The text was updated successfully, but these errors were encountered:
Hey @statisticalplumber,
Thanks for pointing out this issue! We’d really appreciate it if you could raise a PR with the fix — we’ll test it and get it merged.
Thanks again! 🙌
Uh oh!
There was an error while loading. Please reload this page.
https://github.com/agno-agi/agno/blame/62ae18304c4d74375df273478fb0beff04e2a718/libs/agno/agno/agent/agent.py#L2877
Hi Team,
First, I want to express my appreciation for your excellent library—I've been using it extensively in my product development, and it's been a great help!
However, I’ve encountered an issue when saving responses in markdown format that contain emojis. The file doesn't get saved due to an encoding issue when using the save_response_to_file method.
Here’s the code I am using:
The issue seems to stem from the encoding used when writing the response content to the file. The problem was resolved on my end when I modified this line:
fn_path.write_text(self.run_response.content)
tofn_path.write_text(self.run_response.content, encoding="utf-8")
After adding UTF-8 encoding, the emojis were saved correctly. I would like to suggest that you consider providing built-in support for encoding options in the save_response_to_file method, as this would resolve the issue for all users who deal with non-ASCII characters such as emojis.
Thank you for your consideration, and I look forward to any updates or fixes to address this
Note: Also let me know in case you guys want me to raise the pull request with this fix, though this is small.
The text was updated successfully, but these errors were encountered: