Spaces:
Running
Running
Update custom_utils.py
Browse files- custom_utils.py +3 -1
custom_utils.py
CHANGED
@@ -323,7 +323,7 @@ def get_stage_sorting():
|
|
323 |
def invoke_search(db, collection, pipeline):
|
324 |
results = collection.aggregate(pipeline)
|
325 |
|
326 |
-
|
327 |
|
328 |
return list(results)
|
329 |
|
@@ -338,6 +338,8 @@ def get_millis_elapsed(db, collection, pipeline):
|
|
338 |
|
339 |
explain_vector_search = explain_query_execution["stages"][0]["$vectorSearch"]
|
340 |
|
|
|
|
|
341 |
return explain_vector_search["explain"]["collectStats"]["allCollectorStats"]["millisElapsed"]
|
342 |
|
343 |
def get_text_embedding(openai_api_key, text):
|
|
|
323 |
def invoke_search(db, collection, pipeline):
|
324 |
results = collection.aggregate(pipeline)
|
325 |
|
326 |
+
print(f"Vector search millis elapsed: {get_millis_elapsed(db, collection, pipeline)}")
|
327 |
|
328 |
return list(results)
|
329 |
|
|
|
338 |
|
339 |
explain_vector_search = explain_query_execution["stages"][0]["$vectorSearch"]
|
340 |
|
341 |
+
print(explain_vector_search)
|
342 |
+
|
343 |
return explain_vector_search["explain"]["collectStats"]["allCollectorStats"]["millisElapsed"]
|
344 |
|
345 |
def get_text_embedding(openai_api_key, text):
|