Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing partial and incomplete JSON without error #177

Open
SuperPat45 opened this issue Feb 4, 2024 · 1 comment
Open

Parsing partial and incomplete JSON without error #177

SuperPat45 opened this issue Feb 4, 2024 · 1 comment

Comments

@SuperPat45
Copy link

SuperPat45 commented Feb 4, 2024

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:
1 1w9UgbLMDwvHROu7NLUa2g

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.

@UrielCh
Copy link
Contributor

UrielCh commented Mar 12, 2024

Nice! It's not too complicated to implement. If I can pay for it, I'm willing to implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants