File size: 936 Bytes
1149349 | 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 | import requests
import json
url = "http://localhost:5000/api/start-case"
data = {
"disease": "SUY TIM", # Thử với tên chính xác từ database
"sessionId": "test456"
}
print("Testing API with longer timeout...")
print(f"Disease: {data['disease']}")
try:
response = requests.post(url, json=data, timeout=120) # 2 minutes timeout
print(f"\n✅ Status Code: {response.status_code}")
if response.status_code == 200:
result = response.json()
print("\n📋 CASE:")
print(result.get('case', 'N/A')[:200])
print("\n🔍 SYMPTOMS:")
print(result.get('symptoms', 'N/A')[:200])
print(f"\n📚 SOURCES: {len(result.get('sources', []))}")
else:
print(f"\n❌ ERROR:")
print(response.text)
except requests.exceptions.Timeout:
print("\n⏱️ TIMEOUT after 120 seconds!")
except Exception as e:
print(f"\n❌ EXCEPTION: {e}")
|