Closed keenborder786 closed 1 year ago
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: keenborder786
To complete the pull request process, please assign xiaofan-luan after the PR has been reviewed.
You can assign the PR to them by writing /assign @xiaofan-luan
in a comment when ready.
The full list of commands accepted by this bot can be found here.
/assign @xiaofan-luan
@keenborder786 thanks your improvement
If one were required to pass a custom cache_obj, it would necessitate passing the cache_obj during inference time, potentially leading to repetitive passes of the cache_obj. However, with this PR, such repetition will no longer be necessary:
Furthermore, the current limitation of not being able to pass cache_obj during the construction of
LangChainLLMs
prevents you from using a custom cache_obj in other sequential chains likeSQLDatabaseSequentialChain
, where only the global cache object can be used. This restriction arises because there is no provision to pass a custom cache_obj when SQLDatabaseSequentialChain calls the predict method.However, with the implementation of my update, you will have the ability to initialize LangChainLLMs with a custom cache_obj. As a result, when you pass this LangChainLLMs instance into the chain, custom cache_obj will function correctly:
I hope this clarfies the use case and why this will improve the usability of the package.