#!/usr/bin/env python3 """ Monitor deployment after message format fixes """ import time import requests def monitor_message_format_fix(): """Monitor the deployment after fixing message format""" print("šŸ”§ MONITORING AFTER MESSAGE FORMAT FIXES") print("=" * 60) url = "https://huggingface.co/spaces/John-jero/IDAgentsFreshTest" for attempt in range(6): try: print(f"\nā±ļø Check #{attempt + 1} at {time.strftime('%H:%M:%S')}") response = requests.get(url, timeout=20) print(f"Status: {response.status_code}") print(f"Size: {len(response.text):,} bytes") # Check for success indicators text = response.text.lower() if response.status_code == 200: print("āœ… Status 200: Excellent!") # Look for specific success indicators if "infectious diseases agent builder" in text: print("šŸŽ‰ ID AGENTS SUCCESSFULLY DEPLOYED!") print("šŸš€ Your application is now running!") break elif "get started" in text: print("šŸŽÆ Landing page detected - app is working!") break elif "gradio" in text and "agent" in text: print("šŸ¤– Agent interface detected - deployment successful!") break elif "error" in text: print("āš ļø Error detected in response") # Check for specific error patterns if "expected a list" in text or "list of lists" in text: print("šŸ” Message format error may still exist") else: print("šŸ“± App responding - likely successful!") elif response.status_code == 401: print("šŸ” Status 401: Still building/authenticating") elif response.status_code == 502: print("šŸ”§ Status 502: Server restarting") else: print(f"āŒ Status: {response.status_code}") # Show preview preview = response.text[:400].replace('\n', ' ') print(f"Preview: {preview[:150]}...") if attempt < 5: print("ā³ Waiting 25 seconds...") time.sleep(25) except Exception as e: print(f"āŒ Request failed: {e}") if attempt < 5: time.sleep(25) print(f"\nšŸŽÆ FINAL STATUS:") print(f"Visit: {url}") print("\nšŸ” What to look for:") print("• Landing page with 'Infectious Diseases Agent Builder'") print("• 'Get Started' button") print("• No Gradio format errors") print("• Functional simple chatbot") print("\nšŸ”‘ If successful:") print("• Add API keys (OPENAI_API_KEY, SERPER_API_KEY)") print("• Test full agent builder functionality") print("• Verify agent creation and chat features") if __name__ == "__main__": monitor_message_format_fix()