mangiucugna / json_repair

A python module to repair invalid JSON, commonly used to parse the output of LLMs
https://pypi.org/project/json-repair/
MIT License
1.16k stars 65 forks source link

TypeError on malformed string #37

Closed liangjs closed 6 months ago

liangjs commented 6 months ago

Describe the bug The following code throws TypeError: unhashable type: 'dict'. Notice that the json string is malformed (unmatched double quotes), however we should not throw exception in such cases.

To Reproduce

json_repair.loads('''{ "a": "aa", "de": "{ asdf": {} }" }''')