Spaces:
Sleeping
Sleeping
| import requests | |
| def check_api_health(api_url: str) -> dict: | |
| """Check if the backend API is healthy""" | |
| try: | |
| response = requests.get(f"{api_url}/api/v1/health", timeout=10) | |
| response.raise_for_status() | |
| return response.json() | |
| except Exception as e: | |
| return {"status": "unhealthy", "error": str(e)} | |
| def analyze_notes(api_url: str, provider_notes: str) -> dict: | |
| """Send provider notes to backend API for analysis""" | |
| try: | |
| payload = {"provider_notes": provider_notes} | |
| response = requests.post( | |
| f"{api_url}/api/v1/analyze", | |
| json=payload, | |
| headers={"Content-Type": "application/json"}, | |
| timeout=60 | |
| ) | |
| response.raise_for_status() | |
| return response.json() | |
| except Exception as e: | |
| return {"error": str(e)} |