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
826 stars 48 forks source link

TypeError on malformed string #37

Closed liangjs closed 5 months ago

liangjs commented 5 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": {} }" }''')