refactor(cache): add cache attribute to memoized function wrapper

refactor(test_cache.py): update import statements and function names
test(cache): add tests for load_or_build_langchain_object, build_langchain_object_with_caching, build_graph, and cache size limit
This commit is contained in:
Gabriel Almeida 2023-05-06 10:25:44 -03:00 committed by Gabriel Luiz Freitas Almeida
commit 1d5f156a22
2 changed files with 43 additions and 23 deletions

View file

@ -48,6 +48,7 @@ def memoize_dict(maxsize=128):
cache.clear()
wrapper.clear_cache = clear_cache # type: ignore
wrapper.cache = cache # type: ignore
return wrapper
return decorator