Skip to content

Commit b3f062e

Browse files
committed
pass list to pinecone query instead of ndarray
1 parent 2f545d1 commit b3f062e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llm-complete-guide/utils/llm_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,10 @@ def get_topn_similar_docs_pinecone(
419419
Returns:
420420
List[Tuple]: List of tuples containing document content and similarity scores.
421421
"""
422+
# Convert numpy array to list if needed
423+
if isinstance(query_embedding, np.ndarray):
424+
query_embedding = query_embedding.tolist()
425+
422426
# Query the index
423427
results = pinecone_index.query(
424428
vector=query_embedding,

0 commit comments

Comments
 (0)