This repository has been archived on 2025-03-19. You can view files and clone it, but cannot push or open issues or pull requests.
SPJGPT/qdrant_setup.py
2024-12-04 02:35:01 +00:00

30 lines
611 B
Python

from qdrant_client import QdrantClient
from qdrant_client.http.models import Distance, VectorParams
from qdrant_client.models import PointStruct
import openai
import requests
import json
import os
from dotenv import load_dotenv
load_dotenv()
qdrant_api_key = os.getenv('QDRANT_API_KEY')
client = QdrantClient(
url="http://127.0.0.1",
port="6333",
api_key= qdrant_api_key,
)
vector_size = 1536
client.create_collection(
collection_name='Course_Data',
vectors_config={
'Content': VectorParams(
distance=Distance.COSINE,
size=vector_size,
),
}
)