Better HN
topnewbestaskshowjobs
Log inSign up

gurrasson

1 karma · joined Nov 5, 2023 (3y ago) · 1 submissions

Submissions

comment 3y ago · link · parent

The jsonrepair tool https://github.com/josdejong/jsonrepair might interest you. It's tailored to fix JSON strings.

I've been looking into something similar for handling partial JSONs, where you only have the first n chars of a JSON. This is common with LLM with streamed outputs aimed at reducing latency. If one knows the JSON schema ahead, then one can start processing these first fields before the remaining data has fully loaded. If you have to wait for the whole thing to load there is little point in streaming.

Was looking for a library that could do this parsing.