Skip to content

Commit 51a8f38

Browse files
committed
[Bug fix] Bring test_vector_database.py up to date.
1 parent a72f52a commit 51a8f38

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

demos/palm/python/docs-agent/scripts/test_vector_database.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,12 @@ def embed_palm(texts: Documents) -> Embeddings:
108108
model_name=LOCAL_LLM
109109
)
110110

111+
embedding_function_gemini_retrieval = embedding_functions.GoogleGenerativeAiEmbeddingFunction(
112+
api_key=API_KEY, model_name=EMBEDDING_MODEL,
113+
task_type="RETRIEVAL_QUERY")
114+
111115
collection = chroma_client.get_collection(
112-
name=COLLECTION_NAME, embedding_function=emb_fn
116+
name=COLLECTION_NAME, embedding_function=embedding_function_gemini_retrieval
113117
)
114118

115119
results = collection.query(query_texts=[QUESTION], n_results=NUM_RETURNS)

0 commit comments

Comments
 (0)