rajkstats commited on
Commit
aa927d1
·
1 Parent(s): 8baaf77

async qdrant

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -45,6 +45,7 @@ from langchain_openai import OpenAI, OpenAIEmbeddings
45
  from langchain_community.document_loaders import DataFrameLoader
46
  from langchain_community.vectorstores import Qdrant
47
  from qdrant_client import QdrantClient
 
48
 
49
  # Custom evaluations
50
  from custom_eval import PharmAssistEvaluator, HarmfulnessEvaluator, AIDetectionEvaluator
@@ -278,9 +279,9 @@ async def on_chat_start():
278
  QDRANT_API_KEY=os.environ.get("QDRANT_API_KEY")
279
  QDRANT_CLUSTER_URL =os.environ.get("QDRANT_CLUSTER_URL")
280
 
281
- qdrant_client = QdrantClient(url=QDRANT_CLUSTER_URL, api_key=QDRANT_API_KEY,timeout=60)
282
 
283
- response = qdrant_client.get_collections()
284
 
285
  # Extracting the collection names from the response
286
  collection_names = [collection.name for collection in response.collections]
 
45
  from langchain_community.document_loaders import DataFrameLoader
46
  from langchain_community.vectorstores import Qdrant
47
  from qdrant_client import QdrantClient
48
+ from qdrant_client import AsyncQdrantClient
49
 
50
  # Custom evaluations
51
  from custom_eval import PharmAssistEvaluator, HarmfulnessEvaluator, AIDetectionEvaluator
 
279
  QDRANT_API_KEY=os.environ.get("QDRANT_API_KEY")
280
  QDRANT_CLUSTER_URL =os.environ.get("QDRANT_CLUSTER_URL")
281
 
282
+ qdrant_client = AsyncQdrantClient(url=QDRANT_CLUSTER_URL, api_key=QDRANT_API_KEY,timeout=60)
283
 
284
+ response = await qdrant_client.get_collections()
285
 
286
  # Extracting the collection names from the response
287
  collection_names = [collection.name for collection in response.collections]