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

Add retry strategy to OpenAI Chat API requests #43

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

chrisgreg
Copy link
Contributor

@chrisgreg chrisgreg commented Dec 1, 2023

Due to the intermittent issues exposed by Finch disconnecting, this PR adds Req retry logic to API requests.

Retries are attempted up to 3 times and trigger for all HTTP errors with a 1 second delay.

I figure a test wasn't required given the Req library tests this and I've just added in options to trigger it.

Copy link
Owner

@brainlid brainlid left a comment

Choose a reason for hiding this comment

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

That seems like a safe approach, especially if it's addressing the issue for you.

@brainlid
Copy link
Owner

brainlid commented Dec 1, 2023

Thanks!

❤️💛💙💜

@brainlid brainlid merged commit 0b9ffcf into brainlid:main Dec 1, 2023
1 check 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.

2 participants