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

feat: Add OpenAIError to retry mechanism #4178

Merged
merged 4 commits into from
Feb 17, 2023
Merged

Conversation

sjrl
Copy link
Contributor

@sjrl sjrl commented Feb 16, 2023

Related Issues

  • fixes N/A

Proposed Changes:

  • Add OpenAIError to retry mechanism for OpenAIAnswerGenerator and PromptNode
  • Use env variable for timeout for OpenAI request in PromptNode

How did you test it?

Hard to test because it would require OpenAI to return an error.

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added tests that demonstrate the correct behavior of the change
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test:.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@sjrl sjrl requested a review from a team as a code owner February 16, 2023 08:35
@sjrl sjrl requested review from vblagoje and removed request for a team February 16, 2023 08:35
@sjrl
Copy link
Contributor Author

sjrl commented Feb 16, 2023

Hey, @vblagoje let me know if this makes sense to do. We've been having trouble with a lot of 500 errors (internal server errors) from OpenAI so we think it would be helpful to allow for a few retries even if a generic OpenAI error is returned before raising the error to the user.

@sjrl sjrl added the type:feature New feature or request label Feb 16, 2023
Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

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

LGTM

@sjrl
Copy link
Contributor Author

sjrl commented Feb 16, 2023

Can't merge until PR #4163 or PR #4128 is merged to fix CI.

@sjrl sjrl merged commit 44509cd into main Feb 17, 2023
@sjrl sjrl deleted the prompt_node/openai_retry branch February 17, 2023 12:17
@tstadel tstadel added this to the 1.14.0 milestone Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants