multiple-changes-made

This commit is contained in:
eweeman
2026-01-14 11:44:13 -08:00
parent 9d31399518
commit 9de6602e0d
39 changed files with 806 additions and 66 deletions

0
rag/__init__.py Normal file
View File

Binary file not shown.

Binary file not shown.

29
rag/qdrant_functions.py Normal file
View File

@@ -0,0 +1,29 @@
# qdrant_functions.py
import logging
from qdrant_client import QdrantClient
from sentence_transformers import SentenceTransformer
import uuid
import os
QDRANT_HOST = os.getenv("QDRANT_HOST", "localhost")
QDRANT_PORT = int(os.getenv("QDRANT_PORT", 6333))
QDRANT_COLLECTION = os.getenv("QDRANT_COLLECTION", "abot-slack")
client = QdrantClient(host=QDRANT_HOST, port=QDRANT_PORT)
embedding_model = SentenceTransformer("all-MiniLM-L6-v2")
VECTOR_SIZE = 384
def ensure_collection():
collections = [c.name for c in client.get_collections().collections]
if QDRANT_COLLECTION not in collections:
client.create_collection(
collection_name=QDRANT_COLLECTION,
vectors_config={
"size": VECTOR_SIZE,
"distance": "Cosine"
}
)
logging.info(f"Created Qdrant collection {QDRANT_COLLECTION}")
ensure_collection()