mirror of
https://github.com/hwchase17/langchain
synced 2024-11-08 07:10:35 +00:00
fix: Chroma filter symbols not supporting LIKE and CONTAIN (#7169)
Fixing issue with SelfQueryRetriever due to unsupported LIKE and CONTAIN comparators in Chroma's WHERE filter statements. This pull request introduces a redefined set of comparators in Chroma to address the problem and make it compatible with SelfQueryRetriever. For information on the comparators supported by Chroma's filter, please refer to https://docs.trychroma.com/usage-guide#using-where-filters. <img width="495" alt="image" src="https://github.com/hwchase17/langchain/assets/22267652/34789191-0293-4f63-9bdf-ad1e1f2567c4"> --------- Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
This commit is contained in:
parent
26409b01bd
commit
e288410e72
@ -16,6 +16,14 @@ class ChromaTranslator(Visitor):
|
||||
|
||||
allowed_operators = [Operator.AND, Operator.OR]
|
||||
"""Subset of allowed logical operators."""
|
||||
allowed_comparators = [
|
||||
Comparator.EQ,
|
||||
Comparator.GT,
|
||||
Comparator.GTE,
|
||||
Comparator.LT,
|
||||
Comparator.LTE,
|
||||
]
|
||||
"""Subset of allowed logical comparators."""
|
||||
|
||||
def _format_func(self, func: Union[Operator, Comparator]) -> str:
|
||||
self._validate_func(func)
|
||||
|
Loading…
Reference in New Issue
Block a user