Skip to content

fix(parsing): handle whitespace only strings #2007

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

Merged
merged 2 commits into from
Apr 30, 2025
Merged

Conversation

maesta7
Copy link
Contributor

@maesta7 maesta7 commented Jan 11, 2025

…ng from_json

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

  • add filter logic to ensure chunk streaming work properly.

Additional context & links

  • I notice that in some case, when messages stack around 2 - 3 conversation turn, it will throw 'EOF error parsing', so I launch quick check on client lib, and found that, in some use case, server will send empty string with '\n', so it make jiter parsing function error.

@maesta7 maesta7 requested a review from a team as a code owner January 11, 2025 12:13
Copy link
Collaborator

@RobertCraigie RobertCraigie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Paul-DeSimone
Copy link

@RobertCraigie Any chance this PR can be Reviewed + Merged soon? This would fix all of the 'EOF error parsing' issues

@RobertCraigie RobertCraigie changed the title fix: add a check to handle empty or newline-only strings before calling from_json fix(parsing): handle whitespace only strings Apr 30, 2025
@RobertCraigie RobertCraigie changed the base branch from main to next April 30, 2025 15:45
@RobertCraigie RobertCraigie merged commit 246bc5b into openai:next Apr 30, 2025
@stainless-app stainless-app bot mentioned this pull request Apr 30, 2025
stainless-app bot pushed a commit that referenced this pull request May 2, 2025
* fix: add a check to handle empty or newline-only strings before calling `from_json`

* style: adjust comment format for better readability

Co-authored-by: Robert Craigie <[email protected]>

---------

Co-authored-by: SenorSpes <[email protected]>
Co-authored-by: Robert Craigie <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants