mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-16 08:06:14 +00:00
specify comparators (#7805)
This commit is contained in:
parent
ee40d37098
commit
111bd7ddbe
@ -14,7 +14,15 @@ from langchain.chains.query_constructor.ir import (
|
||||
class PineconeTranslator(Visitor):
|
||||
"""Logic for converting internal query language elements to valid filters."""
|
||||
|
||||
allowed_operators = [Operator.AND, Operator.OR]
|
||||
allowed_comparators = (
|
||||
Comparator.EQ,
|
||||
Comparator.LT,
|
||||
Comparator.LTE,
|
||||
Comparator.GT,
|
||||
Comparator.GTE,
|
||||
)
|
||||
"""Subset of allowed logical comparators."""
|
||||
allowed_operators = (Operator.AND, Operator.OR)
|
||||
"""Subset of allowed logical operators."""
|
||||
|
||||
def _format_func(self, func: Union[Operator, Comparator]) -> str:
|
||||
|
@ -19,6 +19,15 @@ if TYPE_CHECKING:
|
||||
class QdrantTranslator(Visitor):
|
||||
"""Logic for converting internal query language elements to valid filters."""
|
||||
|
||||
allowed_comparators = (
|
||||
Comparator.EQ,
|
||||
Comparator.LT,
|
||||
Comparator.LTE,
|
||||
Comparator.GT,
|
||||
Comparator.GTE,
|
||||
)
|
||||
"""Subset of allowed logical comparators."""
|
||||
|
||||
def __init__(self, metadata_key: str):
|
||||
self.metadata_key = metadata_key
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user