Spaces:
Build error
Build error
File size: 567 Bytes
f687d7d c24ff2d f687d7d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
from qdrant_client import QdrantClient
from qdrant_client.http import models
import qdrant_client
import os
from dotenv import load_dotenv
load_dotenv()
qdrant_client = QdrantClient(
url = os.getenv("QDRANT_URL"),
api_key = os.getenv("QDRANT_API_KEY"),
)
try:
collection_info = qdrant_client.get_collection("question_tests")
except Exception as e:
qdrant_client.create_collection(
collection_name="question_tests",
vectors_config=models.VectorParams(size=768, distance=models.Distance.COSINE),
)
print("Qdrant Database connected")
|