Docker_Deploy / src /python /test_qdrant.py
Shaheryar Shah
Add backend files for RAG Chatbot Docker deployment
bec06d9
import asyncio
from vector_store import VectorStore
def test_qdrant():
"""Test Qdrant connection only."""
print("Testing Qdrant connection...")
try:
vector_store = VectorStore()
collections = vector_store.client.get_collections().collections
collection_names = [col.name for col in collections]
print(f"[OK] Qdrant connection successful. Collections: {collection_names}")
# Try creating a collection
vector_store.create_collection()
print(f"[OK] Collection 'physical_ai_docs' exists or was created")
# Check document count
doc_count = vector_store.get_all_documents_count()
print(f"[OK] Current document count: {doc_count}")
return True
except Exception as e:
print(f"[ERROR] Qdrant connection failed: {str(e)}")
import traceback
traceback.print_exc()
return False
if __name__ == "__main__":
success = test_qdrant()
if success:
print("\nQdrant test completed successfully!")
else:
print("\nQdrant test failed.")