Skip to content

Commit

Permalink
Increase Qdrant timeout from defualt 5s to 20s. Getting timeout err w…
Browse files Browse the repository at this point in the history
…/ doc groups.
  • Loading branch information
KastanDay committed Apr 1, 2024
1 parent 5da717c commit 65b642e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ai_ta_backend/database/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down

0 comments on commit 65b642e

Please sign in to comment.