langchain-core 1.6.9: with_retry Now Accepts a Callable
The with_retry function in langchain-core now supports callables, expanding its flexibility for error handling and retries.
What changed?
In langchain-core version 1.6.9, the with_retry function was updated to accept a callable as an argument. This enhances the retry utility and allows developers to pass in a function or lambda for retry operations.
Why does it matter to an everyday developer?
This update increases flexibility for developers building applications that rely on retry logic. Accepting a callable means you can now directly pass functions with custom behavior to with_retry, which simplifies error handling in workflows and reduces boilerplate. Developers are no longer restricted to specific patterns for retries and can adapt the retry mechanism to more complex or dynamic scenarios.
What can the developer do now?
Developers can immediately take advantage of this change by updating to langchain-core 1.6.9. They can now structure retry logic by passing any callable to with_retry, enabling more concise and reusable retry implementations across their LangChain projects.

