File size: 1,085 Bytes
bec06d9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
30
31
32
33
34
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.")