Unsupported Unicode escape sequence
🐛 Bug Report
🔎 Describe the Bug I am parsing a PDF using CrewAI, leading to having some unicode specific characters within my prompts / agent answers. I am then receiving the following error from AgentOps logs:
http_client.py-http_client:109 - WARNING: Could not post data - {'message': "/v2/create_events: Error posting event: Error inserting to table='llms'. Postgres: json['code']='22P05'. json['message']='unsupported Unicode escape sequence'"}
🔄 Reproduction Steps Here are some logs I had. I guess you could reproduce by copy/pasting these feedback logs from CrewAI and inject them to an AgentOps report? Hopefully it does contain one of the specific rejected character:
🖇 AgentOps: Could not post data - {'message': "/v2/create_events: Error posting event: Error inserting to table='llms'. Postgres: json['code']='22P05'. json['message']='unsupported Unicode escape sequence'"} 2024-07-28 08:22:04,985 - 13880029184 - http_client.py-http_client:109 - WARNING: Could not post data - {'message': "/v2/create_events: Error posting event: Error inserting to table='llms'. Postgres: json['code']='22P05'. json['message']='unsupported Unicode escape sequence'"} Thought: I have now gathered sufficient information from the PDF regarding the "Conveniences" section. Next, I will search for the "Places" section to ensure that all relevant details in the received JSON are validated against the PDF content.
Action: Search a PDF's content
Action Input: {"query":"Places","pdf":"http://127.0.0.1:9199/download/storage/v1/b/chez-moi-b8936.appspot.com/o/guide%2FO9LrJX25WLaLgvGUxhg1sjPa1MGx?generation=1722154827928&alt=media"} 2024-07-28 08:22:11,979 - 13859401728 - _utils.py-_utils:463 - WARNING: Ignoring wrong pointing object 6 0 (offset 0) 2024-07-28 08:22:11,980 - 13859401728 - _utils.py-_utils:463 - WARNING: Ignoring wrong pointing object 8 0 (offset 0) 2024-07-28 08:22:11,980 - 13859401728 - _utils.py-_utils:463 - WARNING: Ignoring wrong pointing object 10 0 (offset 0) 2024-07-28 08:22:11,980 - 13859401728 - _utils.py-_utils:463 - WARNING: Ignoring wrong pointing object 12 0 (offset 0) 2024-07-28 08:22:11,980 - 13859401728 - _utils.py-_utils:463 - WARNING: Ignoring wrong pointing object 14 0 (offset 0) 2024-07-28 08:22:11,981 - 13859401728 - _utils.py-_utils:463 - WARNING: Ignoring wrong pointing object 63 0 (offset 0)Relevant Content: located near the house, close to where the car is parked. The Yellow and Green bins should be placed on our sidewalk on Monday nights, while the Brown bin should be put out on Tuesday nights. Hea/ng The hea2ng system in the house is automated. If you're feeling too cold or too hot, please inform us. We can adjust the temperature remotely. Also, we kindly ask that you not to adjust the valves on the heaters as this could disrupt the func2oning of the other heaters in the house. During the winter, you may no2ce a sound similar to a vacuum coming from the basement. This is the hea2ng system refilling.
Gerberoy Considered the “city of the Roses”, this small town looks straight out of a fairytale movie. It can be a very roman2c des2na2on, but also great for family photos. Rouen The capital of Normandy is well known for Jeanne d’Arc’s (Joan of Arc) tragic end. The story of this 19 years warrior, who was burned alive by the English and later on was canonized by the Catholic Church, is celebrated everywhere around this city. Rouen is also known for it’s an2que stores. Deauville and Honfleur Even though these are the furthest des2na2ons from our list, these seaside villages are among the most pres2gious ci2es in France and worth the visit. If you can, visit on a week day, as these touris2c small ci2es can get really crowded during the weekends. Our contact Samantha +33 (0)7.68.15.63.69 Guillaume +33 (0)6.34.60.66.43
must visit. It’s home to his beau2ful gardens, and was portrayed in many of his pain2ngs. You can see with your own eyes the iconic Water-Lily pound and it’s bridge. Thoiry Zoo A Safari style adventure, located only 30 minutes driving from our house. You can hop on a small electric car that will comfortably drive you through the wildlife. They also offer night visits to watch the nocturnal animals. Château de Chan/lly The beau2ful city of Chan2lly and it’s castle are definitely worth a visit. You can picnic with an amazing view in the gardens while children enjoy the nice playground. If you’re driving from/to Belgium or the Netherlands, this is the perfect ac2vity “on the way”.
🖇 AgentOps: Could not post data - {'message': "/v2/create_events: Error posting event: Error inserting to table='llms'. Postgres: json['code']='22P05'. json['message']='unsupported Unicode escape sequence'"} 2024-07-28 08:22:16,302 - 13880029184 - http_client.py-http_client:109 - WARNING: Could not post data - {'message': "/v2/create_events: Error posting event: Error inserting to table='llms'. Postgres: json['code']='22P05'. json['message']='unsupported Unicode escape sequence'"}
🙁 Expected Behavior I would expect for AgentOps to replace the unsupported characters by some empty string instead of rejecting the whole message. So I can still get an "almost" complete report.
📸 Screenshots
Here is what my report currently looks like with all the gaps:
Thank you once again for your amazing work guys!