Playing with the OpenAI’s streaming APIs, the response stream return partial JSON data I need to exploit immediately for smooth experience.
This may be achieved by adding a new clean data functions like:
String data = JSONValue.cleanData(String)
Who can append missing close token like:
Alternatively, this can also be done by adding new parser functions that ignore EOF errors.
JSONValue.parsePartial(...);
or with a new class:
JSONPartialValue.parse(...);
With this, I'll be able to show, to my user, a tree that fills up as data comes in.
Playing with the OpenAI’s streaming APIs, the response stream return partial JSON data I need to exploit immediately for smooth experience.
This may be achieved by adding a new clean data functions like:
String data = JSONValue.cleanData(String)
Who can append missing close token like:Alternatively, this can also be done by adding new parser functions that ignore EOF errors.
JSONValue.parsePartial(...);
or with a new class:JSONPartialValue.parse(...);
With this, I'll be able to show, to my user, a tree that fills up as data comes in.