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: break retry loop for 401 unauthorized errors in promptnode #4389

Merged
merged 11 commits into from
Mar 17, 2023

Conversation

FHardow
Copy link
Member

@FHardow FHardow commented Mar 13, 2023

Related Issues

Proposed Changes:

The PromptNode uses a openai/cohere gateway that has an exponential retry in case the request fails. These retries don't make a lot of sense when the API returns a 401 unauthorized code.

How did you test it?

None. Couldn't find a place where these would fit. Happy to add some if somebody could point me to a place.

Notes for the reviewer

Should we extend this so that we break the retry loop for all 4xx errors and catch specific ones, like the 401 or 429?

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

@vblagoje vblagoje marked this pull request as ready for review March 14, 2023 12:37
@vblagoje vblagoje requested a review from a team as a code owner March 14, 2023 12:37
@vblagoje vblagoje requested review from silvanocerza and removed request for a team March 14, 2023 12:37
@vblagoje
Copy link
Member

@FHardow looks ok to me; I updated the linting, and CI should pass now. I'll let @silvanocerza take over

Copy link
Contributor

@silvanocerza silvanocerza left a comment

Choose a reason for hiding this comment

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

Some small changes to make the logic more straightforward.

I also updated branch with main, it should solve the mypy issues.

@silvanocerza silvanocerza merged commit 4624844 into main Mar 17, 2023
@silvanocerza silvanocerza deleted the feat/4380/unauthorized-error-prompt-node branch March 17, 2023 16:07
@FHardow
Copy link
Member Author

FHardow commented Mar 17, 2023

@silvanocerza thanks for taking care of this PR :)

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

Successfully merging this pull request may close these issues.

Don't retry on 401 in PromptNode
3 participants