From 66f9d25fd202ab5d00f1a90a0e857e1120f3e7b4 Mon Sep 17 00:00:00 2001 From: Daniel Thomas Date: Tue, 27 Feb 2024 12:24:53 +0100 Subject: [PATCH 1/2] Fix filters for Supabase --- llama-index-legacy/llama_index/legacy/vector_stores/supabase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama-index-legacy/llama_index/legacy/vector_stores/supabase.py b/llama-index-legacy/llama_index/legacy/vector_stores/supabase.py index abc4dcba17749..c1a1e02a9b198 100644 --- a/llama-index-legacy/llama_index/legacy/vector_stores/supabase.py +++ b/llama-index-legacy/llama_index/legacy/vector_stores/supabase.py @@ -76,7 +76,7 @@ def client(self) -> None: def _to_vecs_filters(self, filters: MetadataFilters) -> Any: """Convert llama filters to vecs filters. $eq is the only supported operator.""" vecs_filter = defaultdict(list) - filter_cond = f"${filters.condition}" + filter_cond = f"${filters.condition.value}" for f in filters.legacy_filters(): sub_filter = {} From 61198eda7635a7ab7dbf009c9a0c3a60885d1a01 Mon Sep 17 00:00:00 2001 From: Daniel Thomas Date: Tue, 27 Feb 2024 12:46:10 +0100 Subject: [PATCH 2/2] supabase metadata filtering fix --- .../llama_index/vector_stores/supabase/base.py | 2 +- llama-index-legacy/llama_index/legacy/vector_stores/supabase.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llama-index-integrations/vector_stores/llama-index-vector-stores-supabase/llama_index/vector_stores/supabase/base.py b/llama-index-integrations/vector_stores/llama-index-vector-stores-supabase/llama_index/vector_stores/supabase/base.py index 007fd108aa7fd..03dab9d83153b 100644 --- a/llama-index-integrations/vector_stores/llama-index-vector-stores-supabase/llama_index/vector_stores/supabase/base.py +++ b/llama-index-integrations/vector_stores/llama-index-vector-stores-supabase/llama_index/vector_stores/supabase/base.py @@ -71,7 +71,7 @@ def client(self) -> None: def _to_vecs_filters(self, filters: MetadataFilters) -> Any: """Convert llama filters to vecs filters. $eq is the only supported operator.""" vecs_filter = defaultdict(list) - filter_cond = f"${filters.condition}" + filter_cond = f"${filters.condition.value}" for f in filters.legacy_filters(): sub_filter = {} diff --git a/llama-index-legacy/llama_index/legacy/vector_stores/supabase.py b/llama-index-legacy/llama_index/legacy/vector_stores/supabase.py index c1a1e02a9b198..abc4dcba17749 100644 --- a/llama-index-legacy/llama_index/legacy/vector_stores/supabase.py +++ b/llama-index-legacy/llama_index/legacy/vector_stores/supabase.py @@ -76,7 +76,7 @@ def client(self) -> None: def _to_vecs_filters(self, filters: MetadataFilters) -> Any: """Convert llama filters to vecs filters. $eq is the only supported operator.""" vecs_filter = defaultdict(list) - filter_cond = f"${filters.condition.value}" + filter_cond = f"${filters.condition}" for f in filters.legacy_filters(): sub_filter = {}