diff --git a/gptcache/manager/vector_data/pgvector.py b/gptcache/manager/vector_data/pgvector.py index 95bf9ffd..55ab0c99 100644 --- a/gptcache/manager/vector_data/pgvector.py +++ b/gptcache/manager/vector_data/pgvector.py @@ -149,7 +149,7 @@ def search(self, data: np.ndarray, top_k: int = -1): ).order_by( similarity ).limit(top_k).all() - search_result = [(r[0].id, r[1]) for r in search_result] + search_result = [(r[1], r[0].id) for r in search_result] return search_result