-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
JSON returned by json_repair is not in expected format #20
Comments
that's a super weird return value with those double double quotes, I will look into it. Do you know by any chance why the output is formatted like that? |
This is extracted from AIMessage returned from Langchain. I tried to use my custom parser instead of parsers provided by Langchain because they were not able to handle broken JSONs. |
I have released 0.12.0 to support this format, let me know if it works for you as it passed all tests for me |
Thank you for this quick fix. I will check it and let you know in any case of failure with new similar data. |
Hi @mangiucugna, Thank you for your efforts on this. I've encountered a similar issue with the output from the LLM. It seems that the For instance, when trying to repair the following JSON string:
The current output is:
However, the expected output should be:
It seems like the function is having trouble handling certain characters or nested structures properly. Would you mind looking into this further? Thank you again for your attention to this matter. |
Hi @nikolaysm can you open a new issue for that? The issue is with the fact that the right format is |
Describe the bug
Returned json by
json_repair
is not in correct format which was expected.To Reproduce
Steps to reproduce the behavior:
Run the file in python environment with
langchain
andjson_repair
installedExpected behavior
I expected the
repair_json
to repair the output json.Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
OpenAI has returned incomplete json due to limit in completion prompt. The json is missing
":"
after'answer40'
at the end of the response. I expectedjson_repair
to fix the issue but it has created unexpected json.Code to get the json:
JSON return by json_repair:
The text was updated successfully, but these errors were encountered: