mirror of
https://github.com/hwchase17/langchain
synced 2024-11-04 06:00:26 +00:00
- Issue: #8343 Signed-off-by: Pranay Chandekar <pranayc6@gmail.com>
This commit is contained in:
parent
934ea80780
commit
41bb3a6f9b
@ -445,8 +445,10 @@ class GPTCache(BaseCache):
|
||||
"""Get a cache object.
|
||||
|
||||
When the corresponding llm model cache does not exist, it will be created."""
|
||||
|
||||
return self.gptcache_dict.get(llm_string, self._new_gptcache(llm_string))
|
||||
_gptcache = self.gptcache_dict.get(llm_string, None)
|
||||
if not _gptcache:
|
||||
_gptcache = self._new_gptcache(llm_string)
|
||||
return _gptcache
|
||||
|
||||
def lookup(self, prompt: str, llm_string: str) -> Optional[RETURN_VAL_TYPE]:
|
||||
"""Look up the cache data.
|
||||
|
Loading…
Reference in New Issue
Block a user