import requests import time # The URL of your Hugging Face Space API_URL = "https://loomisgitarrist-personal-coder-ai.hf.space" def test_api(): print(f"Testing API at: {API_URL}") # 0. Reset Memory (Ensure clean state) print("0. Resetting Memory...") try: reset_response = requests.get(f"{API_URL}/reset", timeout=10) if reset_response.status_code == 200: print("✅ Memory Reset Successful") else: print(f"⚠️ Memory Reset Failed: {reset_response.status_code}") except Exception as e: print(f"⚠️ Memory Reset Error: {e}") # 1. Check UI print("\n1. Checking UI availability...") try: ui_response = requests.get(API_URL, timeout=10) if ui_response.status_code == 200 and "