Just wanted to say thanks #3
Replies: 5 comments 15 replies
-
For simple output I actually gave up on JSON and got it to generate simple CSV instead, and then turned that back into structured data afterwards. I suspect one issue is that if you want a higher temperature to get varied content, then the LLM is not going to just vary the content of the JSON more, but also its structure. |
Beta Was this translation helpful? Give feedback.
-
Hi David, thank you. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the output, indeed json_repair was getting rid of newlines and breaking everything in your python function. I have added your function to the tests and published 0.1.9 that fixes that test case. Let me know if it works for you! |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for this library @mangiucugna . I was struggling a lot with LLM responses when asking them to give me JSON outputs. Wrote multiple functions to handle all sorts of broken Json but still that wasn't enough. Your library seems to handle all sorts of broken jsons so far. Great work. Loved it |
Beta Was this translation helpful? Give feedback.
-
same i also wanted to say thanks , this helps in data pipelines as well |
Beta Was this translation helpful? Give feedback.
-
I've been building a GPT-powered automation framework that does a lot of file-writing using function calling. It has been a huge hassle trying to figure out a good way to handle broken JSON, and it happens too often to ignore. Using json-repair worked better than my own solution, and allowed me to remove some bulky, annoying-to-maintain code.
So Thanks!
P.S. I got even better results from simply adding "using JSON compatible unicode characters only" to the description of the relevant parameter of my function (again, for GPT function calling). When there's an issue its usually handled pretty well by json-repair, but I went from having issues 30-50% of the time, to 5% after doing that.
Beta Was this translation helpful? Give feedback.
All reactions