#!/usr/bin/env python3 """ Simple test script to verify Qdrant connection Auto-generated by deployment/scripts/setup_local_env.sh """ import os import sys from src.services.vector_db import VectorDatabaseService def test_qdrant_connection(): """Test the connection to Qdrant""" # Set environment variables from deployed infrastructure os.environ['QDRANT_HOST'] = '34.171.134.17' os.environ['QDRANT_PORT'] = '6333' try: print("Testing Qdrant connection...") print(f"Host: {os.environ['QDRANT_HOST']}") print(f"Port: {os.environ['QDRANT_PORT']}") # Initialize the service vector_db = VectorDatabaseService() # Test health check is_healthy = vector_db.health_check() print(f"Health check: {'āœ“ PASSED' if is_healthy else 'āœ— FAILED'}") # Get collection info collection_info = vector_db.get_collection_info() print(f"Collection info: {collection_info}") print("\nāœ“ Qdrant connection test PASSED!") return True except Exception as e: print(f"\nāœ— Qdrant connection test FAILED: {e}") return False if __name__ == "__main__": success = test_qdrant_connection() sys.exit(0 if success else 1)