"""Create a RedisTag inequality filter expression
        Args:
            other (Union[List[str], str]): The tag(s) to filter on.
        Example:
            >>> from langchain.vectorstores.redis import RedisTag
            >>> filter = RedisTag("brand") != "nike"
        """
        self._set_tag_value(other, RedisFilterOperator.NE)
        return RedisFilterExpression(str(self))
    @property
    def _formatted_tag_value(self) -> str:
        return "|".join([self.escaper.escape(tag) for tag in self._value])
    def __str__(self) -> str:
        if not self._value:
            raise ValueError(
                f"Operator must be used before calling __str__. Operators are "
                f"{self.OPERATORS.values()}"
            )
        """Return the Redis Query syntax for a RedisTag filter expression"""
        return self.OPERATOR_MAP[self._operator] % (
            self._field,
            self._formatted_tag_value,
        )
[docs]class RedisNum(RedisFilterField):
    """A RedisFilterField representing a numeric field in a Redis index."""
    OPERATORS: Dict[RedisFilterOperator, str] = {
        RedisFilterOperator.EQ: "==",
        RedisFilterOperator.NE: "!=",
        RedisFilterOperator.LT: "<",
        RedisFilterOperator.GT: ">",
        RedisFilterOperator.LE: "<=",
        RedisFilterOperator.GE: ">=",
    }
    OPERATOR_MAP: Dict[RedisFilterOperator, str] = {
        RedisFilterOperator.EQ: "@%s:[%f %f]",
        RedisFilterOperator.NE: "(-@%s:[%f %f])",