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: handling OpenAI returning None objects #2280

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

jeaninejuliettes
Copy link
Contributor

What does this PR do?

Fixes #2176
OpenAI sometimes returns a None type object instead of a response object. This could happen when you, for instance, run into a rate limit issue or a content violation error. To prevent the whole run to fail, a check is added if the response object is not of type None, if the object is of type None, the label for that specific topic is set to "No label returned". This approach of handling an issue when generating the label for a topic was chosen in a previous iteration and is kept as is.

No documentation has been added with this PR since this is a very minor fix that doesn't influence documentation. There has been a comment added to the code in line with a previously iteration done to the code.
No tests have been added.

Before submitting

  • This PR fixes a typo or improves the docs (if yes, ignore all other checks!).
  • Did you read the contributor guideline?
  • Was this discussed/approved via a Github issue? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes (if applicable)?
  • Did you write any new necessary tests?

@MaartenGr MaartenGr merged commit f3900ad into MaartenGr:master Feb 7, 2025
6 checks passed
@MaartenGr
Copy link
Owner

Thanks for the PR!

This is great, seems like a simple enough and straightforward solution for the fix without needing to overly document this.

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.

OpenAI representation fails to produce output when response content is None
2 participants