发布

  • feat(llms.json_load): Recursively load json lists (#593)

    frostbyte_neo 发布于 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_json with _load_all_jsons which 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

    下载附件