✨ feat(chat.py): use LRUCache from cachetools to limit the size of flow_data_store

The cachetools package is added as a dependency to improve caching. In chat.py, a ValueError is raised if no ID is provided in init_build to prevent errors. The flow_data_store dictionary is replaced with an LRUCache from cachetools to limit the size of the cache to 10 items. This improves performance by reducing the memory usage of the application.
📦 chore(pyproject.toml): add cachetools dependency to improve caching
🐛 fix(chat.py): raise ValueError if no ID is provided in init_build
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-16 15:07:39 -03:00
commit deb056df32
3 changed files with 6 additions and 3 deletions

View file

@ -61,6 +61,7 @@ faiss-cpu = "^1.7.4"
anthropic = "^0.2.9"
orjson = "^3.9.0"
multiprocess = "^0.70.14"
cachetools = "^5.3.1"
[tool.poetry.group.dev.dependencies]