Closed grski closed 11 months ago
Did a small refactor and encapsualted the default cache that you've used. it probably still needs some work to achieve full integration though.
@ishaan-jaff @krrishdholakia any opinions so far guys? This needs some love & testing, will gladly help, but I need the intial approval to push things forward.
any feedback here...?
Sorry for the delay @grski will take a look and respond by EOD
thank you very much, no need to hurry if you have other priorities, the information is enough that you have this on the todo list, no worries :)
@ishaan-jaff @krrishdholakia It's finally done. The tests pass. Linting applied. No conflicts with main (it's merged into this branch).
For now, we do the simplest approach possible, meaning we cache the results in Redis. Using exact match strategy. In the future this should be extended to other stores and similarity based matching to enable true semantic caching. For that vector store handling needs to be added. Proper exception handling.
Validations and defaults for environment variables were added using pydantic and python-dotenv for local setup. In the future this should be used to load and validate all the env variables as it's currently the preferred go-to approach in Python world. Tests need to be added, but for that to happen I think we should refactor the whole testing approach.
Pipelines will fail coz of some lints that are still left out there to be fixed and some tests that were broken since the beginning. We also need to work on that.
Documentation to follow if this implementation is deemed merge-worthy.