Skip to content

The agent engineering platform.

fix: Chroma filter symbols not supporting LIKE and CONTAIN (#7169)

whyinge288410e728f
diff --git a/langchain/retrievers/self_query/chroma.py b/langchain/retrievers/self_query/chroma.py
index 44be86650d..cbb707d1ac 100644
--- a/langchain/retrievers/self_query/chroma.py
+++ b/langchain/retrievers/self_query/chroma.py
@@ -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)