File size: 1,017 Bytes
2fb08d7 | 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 35 36 | """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()
|