SmartArabicSpeechTherapy / quick_test.py
MON3EMPASHA's picture
Add AI service for Docker Space
2fb08d7
Raw
History Blame Contribute Delete
1.02 kB
"""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()