mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

Sets up metadata db for every llm class

Open PranavPuranik opened this issue 1 year ago • 6 comments

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

PranavPuranik avatar Jun 09 '24 21:06 PranavPuranik

Hi @PranavPuranik Can you please check why tests are failing?

Dev-Khant avatar Jun 10 '24 06:06 Dev-Khant

#1449 will fix psutil not found issue.

Dev-Khant avatar Jun 28 '24 05:06 Dev-Khant

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 avatar Jun 28 '24 17:06 PranavPuranik

@PranavPuranik can you please resolve the conflict here? Changes look good.

deshraj avatar Jul 05 '24 15:07 deshraj

resolving

PranavPuranik avatar Jul 06 '24 04:07 PranavPuranik

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 26 '24 02:07 CLAassistant