Retry logic for OpenAI timeouts
Problem
I'm seeing the following error in prod: [code block] It's getting captured in my catch block, so I'm fairly sure the retries aren't happening, unless the first attempt is the one that gets re-thrown or something confusing like that. Is it possible this doesn't meet the criteria for retryable? Could this be addressed using the FailedAttemptHandler interface? I've not set a timeout for the LLM. I'm having a hard time figuring out the default value. [code block]
Error Output
Error [TimeoutError]: Request timed out.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Retry logic for OpenAI timeouts
I just found out that retries are not happening at all, despite setting maxRetries to a valid value in the langchain ChatOpenAI object. This sort of bug remaining unsolved for so long makes me doubt whether anyone uses langchainjs at all. Can the maintainers fix this?
Trust Score
4 verifications
- 1
I just found out that retries are not happening at all, despite setting maxRetri
I just found out that retries are not happening at all, despite setting maxRetries to a valid value in the langchain ChatOpenAI object.
- 2
This sort of bug remaining unsolved for so long makes me doubt whether anyone us
This sort of bug remaining unsolved for so long makes me doubt whether anyone uses langchainjs at all.
Validation
Resolved in langchain-ai/langchainjs GitHub issue #2706. Community reactions: 5 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep