Sets up metadata db for every llm class
Description
The metadata database for storing chat history is a sqllite3 db. It is setup up in the app class by using setup_engine.
But running individual tests in llm folder fails because we don't create any app for tests. Individual llm classes are called independently. Thus, setup_engine is never called.
This change moves the setup to BaseLlmConfig, which is called every time we load an llm.
Fixes #1400
Type of change
Please delete options that are not relevant.
- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [X] Refactor (does not change functionality, e.g. code style improvements, linting)
- [ ] Documentation update
How Has This Been Tested?
Tested individual tests in llm folder, and also tested running my demo app.
- [X] Unit Test
- [ ] Test Script (please provide)
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] I have checked my code and corrected any misspellings
Maintainer Checklist
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] Made sure Checks passed
Hi @PranavPuranik Can you please check why tests are failing?
#1449 will fix psutil not found issue.
Nice, I will wait till its merged in. All tests are passing my laptop - for every commit. Funny how they end up failing here in CI... Investigating
@PranavPuranik can you please resolve the conflict here? Changes look good.
resolving