Files
Analytical_engine_backend/test_api.py
2026-05-11 12:36:20 +05:30

13 lines
365 B
Python

import requests
import json
url = "http://localhost:8000/chat"
payload = {"message": "Who is the top revenue tenant?"}
try:
response = requests.post(url, json=payload, timeout=120)
data = response.json()
print(f"Analysis: {data.get('analysis')}")
print(f"Generated SQL: {data.get('generated_sql')}")
except Exception as e:
print(f"Error: {e}")