Skip to content
Snippets Groups Projects
Unverified Commit cb600470 authored by Dheeraj Agrawal's avatar Dheeraj Agrawal Committed by GitHub
Browse files

Adding support more filters pinecone (#9683)

adding support for one more filter  i.e not in array for pinecone vector store.
parent 6c6f5863
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,7 @@ repos: ...@@ -64,6 +64,7 @@ repos:
- id: codespell - id: codespell
additional_dependencies: [tomli] additional_dependencies: [tomli]
exclude: llama_index/_static exclude: llama_index/_static
args: ["--ignore-words-list", "nin"]
- repo: https://github.com/srstevenson/nb-clean - repo: https://github.com/srstevenson/nb-clean
rev: 3.1.0 rev: 3.1.0
hooks: hooks:
......
"""Pinecone Vector store index. """
Pinecone Vector store index.
An index that that is built on top of an existing vector store. An index that that is built on top of an existing vector store.
...@@ -61,6 +62,8 @@ def _transform_pinecone_filter_operator(operator: str) -> str: ...@@ -61,6 +62,8 @@ def _transform_pinecone_filter_operator(operator: str) -> str:
return "$lte" return "$lte"
elif operator == "in": elif operator == "in":
return "$in" return "$in"
elif operator == "nin":
return "$nin"
else: else:
raise ValueError(f"Filter operator {operator} not supported") raise ValueError(f"Filter operator {operator} not supported")
......
...@@ -69,6 +69,7 @@ class FilterOperator(str, Enum): ...@@ -69,6 +69,7 @@ class FilterOperator(str, Enum):
GTE = ">=" # greater than or equal to (int, float) GTE = ">=" # greater than or equal to (int, float)
LTE = "<=" # less than or equal to (int, float) LTE = "<=" # less than or equal to (int, float)
IN = "in" # In array (string or number) IN = "in" # In array (string or number)
NIN = "nin" # Not in array (string or number)
class FilterCondition(str, Enum): class FilterCondition(str, Enum):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment