-
feat(llms.json_load): Recursively load json lists (#593)
发布于
2024-02-15 08:55:26 +00:00 Slightly broken json are protected against by the function
ragas.llms.json_load.JsonLoader._find_outermost_json. However, I've
found that for many metrics, gpt4 can often return slightly broken json
lists, for which this function returns only the first valid json. Here
we wrap_find_outermost_jsonwith_load_all_jsonswhich calls it
recursively to load the full json list.I.e. expected output for
'{"1":"2"}, ,, {"3":"4"}]'is[{'1': '2'}, {'3': '4'}]
Co-authored-by: jjmachan jamesjithin97@gmail.com
下载附件