How can I check cache existence before retrieval when using RetrievalQA of langchain? #520
Unanswered
SleepingSkipper
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The existence of cache is checked after document retrieval is done (after the _get_docs method of RetrievalQA class is called).
https://github.com/langchain-ai/langchain/blob/b379c5f9c89199370d9175ce6ee34d469567e533/libs/langchain/langchain/chains/retrieval_qa/base.py#L139
To be more efficient, I would like to check the existence of cache before retrieval. Any idea how to implement this?
Here is my code. I referenced this page: https://gptcache.readthedocs.io/en/latest/bootcamp/langchain/question_answering.html#init-for-similar-match-cache
Beta Was this translation helpful? Give feedback.
All reactions