Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python3 | |
| """ | |
| Comprehensive monitoring after removing ChatMessage import | |
| """ | |
| import time | |
| import requests | |
| def comprehensive_monitor(): | |
| """Monitor the deployment with detailed analysis""" | |
| print("π§ COMPREHENSIVE MONITORING AFTER IMPORT FIXES") | |
| print("=" * 70) | |
| url = "https://huggingface.co/spaces/John-jero/IDAgentsFreshTest" | |
| for attempt in range(8): # Extended monitoring | |
| try: | |
| print(f"\nβ±οΈ Check #{attempt + 1} at {time.strftime('%H:%M:%S')}") | |
| response = requests.get(url, timeout=25) | |
| 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 app components | |
| if "infectious diseases agent builder" in text: | |
| print("π ID AGENTS INTERFACE DETECTED!") | |
| print("π Your app is now running successfully!") | |
| break | |
| elif "agent builder" in text: | |
| print("π€ Agent builder detected - app is working!") | |
| break | |
| elif "get started" in text: | |
| print("π― Landing page detected - app loading...") | |
| elif "gradio" in text: | |
| print("π± Gradio framework active...") | |
| elif "error" in text: | |
| print("β οΈ Error detected in response") | |
| # Show more context if error | |
| if "chatbot" in text and "type" in text: | |
| print("π Possible Chatbot type error detected") | |
| elif "building" in text or "preparing" in text: | |
| print("π Still building...") | |
| else: | |
| print("π± Response received, analyzing...") | |
| elif response.status_code == 401: | |
| print("π Status 401: Authentication/build page") | |
| elif response.status_code == 502: | |
| print("π§ Status 502: Server starting/restarting") | |
| else: | |
| print(f"β Unexpected status: {response.status_code}") | |
| # Show detailed preview for debugging | |
| preview = response.text[:500].replace('\n', ' ').replace('\r', '') | |
| print(f"Content preview: {preview[:200]}...") | |
| # Look for specific error patterns | |
| error_patterns = [ | |
| "chatbot.__init__", | |
| "unexpected keyword argument", | |
| "type", | |
| "gradio", | |
| "failed to launch" | |
| ] | |
| for pattern in error_patterns: | |
| if pattern in text: | |
| print(f"π Detected pattern: '{pattern}'") | |
| if attempt < 7: | |
| print("β³ Waiting 20 seconds...") | |
| time.sleep(20) | |
| except Exception as e: | |
| print(f"β Request failed: {e}") | |
| if attempt < 7: | |
| time.sleep(20) | |
| print(f"\nπ― FINAL ASSESSMENT:") | |
| print(f"Visit: {url}") | |
| print("\nπ Expected to see:") | |
| print("β’ Landing page with 'Infectious Diseases Agent Builder' title") | |
| print("β’ 'Get Started' button") | |
| print("β’ Simple chatbot interface") | |
| print("β’ No Gradio/Chatbot error messages") | |
| print("\nπ If successful, next actions:") | |
| print("β’ Add OPENAI_API_KEY in HF Space settings") | |
| print("β’ Add SERPER_API_KEY in HF Space settings") | |
| print("β’ Test agent creation functionality") | |
| print("β’ Verify full agent builder workflow") | |
| if __name__ == "__main__": | |
| comprehensive_monitor() | |