| """Quick test to verify AI service is functional""" | |
| import requests | |
| import sys | |
| def test_health(): | |
| """Test health endpoint""" | |
| try: | |
| response = requests.get("http://localhost:8000/health", timeout=5) | |
| if response.status_code == 200: | |
| data = response.json() | |
| print(f"β Health check passed: {data}") | |
| return True | |
| else: | |
| print(f"β Health check failed: {response.status_code}") | |
| return False | |
| except Exception as e: | |
| print(f"β Could not connect to AI service: {e}") | |
| return False | |
| def main(): | |
| print("=" * 50) | |
| print("Quick AI Service Test") | |
| print("=" * 50) | |
| if test_health(): | |
| print("\nβ AI Service is running and responsive!") | |
| sys.exit(0) | |
| else: | |
| print("\nβ AI Service is not responding") | |
| print("Make sure to start it with:") | |
| print(" uvicorn main:app --reload --host 0.0.0.0 --port 8000") | |
| sys.exit(1) | |
| if __name__ == "__main__": | |
| main() | |