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

Fix crash when delta in openai api handling could be empty in some ca… #644

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

Szpadel
Copy link

@Szpadel Szpadel commented Jan 29, 2025

…ses.

Fixes #641

this will ensure delta is an empty object in case of undefined and checks are no longer needed for each usage

Description

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist:

  • My code follows the patterns of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Additional context

Related Issues

Reviewers


Important

Fix crash in createMessage() in openai.ts by initializing delta as an empty object if undefined.

  • Bug Fix:
    • In openai.ts, createMessage() now initializes delta as an empty object if undefined, preventing crashes when delta is empty.
    • Handles cases where delta.content or delta.reasoning_content might be accessed when delta is undefined.

This description was created by Ellipsis for 60cb550. It will automatically update as commits are pushed.

Copy link

changeset-bot bot commented Jan 29, 2025

⚠️ No Changeset found

Latest commit: 60cb550

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

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

Thank you for the quick fix!

@mrubens mrubens merged commit fc688bb into RooVetGit:main Jan 29, 2025
6 checks passed
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.

Cannot use 'in' operator to search for 'reasoning_content' in undefined
2 participants