From 65b642e2ef968aa545d78256b068ea0e71bf18a4 Mon Sep 17 00:00:00 2001 From: Kastan Day Date: Mon, 1 Apr 2024 13:54:18 -0700 Subject: [PATCH] Increase Qdrant timeout from defualt 5s to 20s. Getting timeout err w/ doc groups. --- ai_ta_backend/database/vector.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ai_ta_backend/database/vector.py b/ai_ta_backend/database/vector.py index e7f2d5e8..70a212e1 100644 --- a/ai_ta_backend/database/vector.py +++ b/ai_ta_backend/database/vector.py @@ -23,11 +23,14 @@ def __init__(self): self.qdrant_client = QdrantClient( url=os.environ['QDRANT_URL'], api_key=os.environ['QDRANT_API_KEY'], + timeout=20, # default is 5 seconds. Getting timeout errors w/ document groups. ) - self.vectorstore = Qdrant(client=self.qdrant_client, - collection_name=os.environ['QDRANT_COLLECTION_NAME'], - embeddings=OpenAIEmbeddings(openai_api_type=OPENAI_API_TYPE)) + self.vectorstore = Qdrant( + client=self.qdrant_client, + collection_name=os.environ['QDRANT_COLLECTION_NAME'], + embeddings=OpenAIEmbeddings(openai_api_type=OPENAI_API_TYPE), + ) def vector_search(self, search_query, course_name, doc_groups: List[str], user_query_embedding, top_n): """