Skip to content

Commit 1bc74a5

Browse files
committed
fix usage
1 parent 5d8af3c commit 1bc74a5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crewai-tools/test_mongodb_vector_search_tool.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from crewai import Agent
33
from crewai import Task
44
from crewai import Crew, Process
5-
from crewai_tools import MongoDBVectorSearchTool
5+
from crewai_tools import MongoDBVectorSearchTool, MongoDBVectorSearchConfig
66
from langchain_community.document_loaders import PyPDFLoader
77
import time
88

@@ -36,9 +36,10 @@
3636

3737
# Wait for index to be complete.
3838
n_docs = coll.count_documents({})
39+
tool.query_config = MongoDBVectorSearchConfig(limit=n_docs, oversampling_factor=1)
3940
start = time.monotonic()
4041
while time.monotonic() - start <= 60:
41-
if len(tool._run(query="sandwich", limit=n_docs, oversampling_factor=1)) == n_docs:
42+
if len(tool._run("sandwich")) == n_docs:
4243
break
4344
else:
4445
time.sleep(1)

0 commit comments

Comments
 (0)