v2rockets / Loyal-Elephie

Your Trusty Memory-enabled AI Companion - Multilingual RAG chatbot optimized for local LLMs | OpenAI API Compatible
MIT License
208 stars 19 forks source link

Exception on where condition when accessing chromadb #7

Closed a-rbts closed 3 weeks ago

a-rbts commented 1 month ago

There are a few failure cases where an exception is thrown after the first prompt, when no history is present. One of them happens upon querying chromadb with a where condition on dates (the variables are called start_time and end_time but are actually dates without timestamps) because chromadb explicitly disallows comparisons on strings here.

This makes queries generated here to be improper since start_time_str (and end_time_str) are strings.

The backend then immediately throws without possibility to recover.

v2rockets commented 1 month ago

Oh, this app need string comparisons but chromadb limits the gte/lte for only int and float. So I've modified the original chroma code, but it seems not wise for an open source project. So let me try update a "monkey patch" https://github.com/v2rockets/Loyal-Elephie/commit/ced7580edc9c01bbd4ffcec59532c570a5b37905 and see if it works!