zilliztech / GPTCache

Semantic cache for LLMs. Fully integrated with LangChain and llama_index.
https://gptcache.readthedocs.io
MIT License
6.89k stars 480 forks source link

Avoid installing Redis library if it's not used #574

Closed leio10 closed 7 months ago

leio10 commented 7 months ago

This PR tries to solve #521.

Instead of loading the Redis cache module to import a class, it checks the value of the parameter given to the factory. This is important, because the module loading process tries to install redis library if it's not installed, even if it's not used.

sre-ci-robot commented 7 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: leio10 To complete the pull request process, please assign cxie after the PR has been reviewed. You can assign the PR to them by writing /assign @cxie in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/zilliztech/GPTCache/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
sre-ci-robot commented 7 months ago

Welcome @leio10! It looks like this is your first PR to zilliztech/GPTCache 🎉