3 ms·
Show HN: GJP-4-GPT, a Gradual JSON Parser for GPT's
Often it's easiest to have an LLM output the results you need in JSON form, but streaming those outputs into an actual viewport is nontrivial. Thus I made this package, a streaming JSON parser that handles all the work of decoding your JSON so you can focus on displaying your UIs.
- explaininjs 3y agoI also provide utilities for dealing with OpenAI-style HTTP response streams, never worry about splitting out the `data:` prefix and JSON parsing the rest, but making sure to include the last chunk if that was incomplete, but also looking out for errors, etc. etc. etc..... again!