#!/usr/bin/env python3 """ Hackathon Demo Launcher LLM-Agent-Designed Obstacle-Passing Vehicle System Track 3: Agentic Demo Showcase """ import sys import os import ssl # SSL workaround for Gradio/network issues try: import certifi os.environ['SSL_CERT_FILE'] = certifi.where() except ImportError: pass # Try to disable SSL verification as a workaround try: ssl._create_default_https_context = ssl._create_unverified_context except AttributeError: pass import webbrowser import time def print_banner(): """Print the hackathon banner""" print("=" * 80) print("šŸ¤–šŸš LLM-AGENT-DESIGNED VEHICLE SYSTEM - HACKATHON DEMO") print(" TRACK 3: AGENTIC DEMO SHOWCASE") print("=" * 80) print() def check_dependencies(): """Check if all required dependencies are installed""" print("šŸ” Checking dependencies...") missing_deps = [] # Check for required packages required_packages = [ ('gradio', 'gradio'), ('pybullet', 'pybullet'), ('transformers', 'transformers'), ('torch', 'torch'), ('Pillow', 'PIL'), ('imageio', 'imageio'), ('numpy', 'numpy') ] for package_name, import_name in required_packages: try: __import__(import_name) print(f" āœ… {package_name}") except ImportError: print(f" āŒ {package_name} - MISSING") missing_deps.append(package_name) except Exception as e: print(f" āš ļø {package_name} - Import warning: {str(e)[:50]}...") if missing_deps: print(f"\nāš ļø Missing dependencies: {', '.join(missing_deps)}") print("Please install them using:") print(" pip install -r requirements.txt") return False print("āœ… All dependencies are available!") return True def show_options(): """Show available demo options""" print("\nšŸŽÆ HACKATHON DEMO OPTIONS:") print() print("1. 🌐 Interactive Gradio Web Interface (Recommended)") print(" - Full agentic demo with real-time feedback") print(" - Visual simulation results") print(" - Downloadable design specifications") print() print("2. šŸ–„ļø System Demonstration & Feature Overview") print(" - Comprehensive feature walkthrough") print(" - Technical implementation details") print(" - Hackathon judging criteria alignment") print() print("3. šŸ“š Documentation & README Preview") print(" - View generated README content") print(" - Submission materials overview") print() def launch_gradio_demo(): """Launch the main Gradio interface""" print("šŸš€ Launching Interactive Gradio Demo...") print("This will start the web interface where you can:") print(" • Select vehicle type (robot/drone)") print(" • Describe your design task in natural language") print(" • Watch the LLM agent work in real-time") print(" • See physics simulation results") print(" • Download design specifications") print() try: from main_orchestrator import create_hackathon_gradio_interface print("Creating interface...") interface = create_hackathon_gradio_interface() print("āœ… Interface created successfully!") print() print("🌐 Starting web server...") print("šŸ“‹ The demo will open in your browser automatically") print("šŸ”— URL: http://localhost:7860") print() print("šŸ’” TIP: Try these example tasks:") print(" • 'Design a robot that crosses quickly and stops safely'") print(" • 'Create a drone that flies over and lands gently'") print(" • 'Build a stable robot for rough terrain'") print() print("āš ļø Press Ctrl+C to stop the server") print() # Launch with browser opening interface.launch( server_name="0.0.0.0", server_port=7860, share=False, # Set to True for public sharing show_error=True, inbrowser=True, quiet=False ) except Exception as e: print(f"āŒ Error launching Gradio demo: {e}") print("Please check your installation and try again.") return False return True def run_system_demo(): """Run the comprehensive system demonstration""" print("šŸ–„ļø Running System Demonstration...") print() try: from hackathon_demo import main main() except Exception as e: print(f"āŒ Error running system demo: {e}") return False return True def show_readme(): """Display README content""" print("šŸ“š README & Documentation Preview...") print() try: with open('README.md', 'r', encoding='utf-8') as f: content = f.read() # Show first part of README lines = content.split('\n') preview_lines = lines[:50] # Show first 50 lines for line in preview_lines: print(line) if len(lines) > 50: print("\n... (README continues - see README.md for full content)") print(f"\nšŸ“„ Full README available in: README.md") print(f"šŸ“Š Total README length: {len(lines)} lines") except Exception as e: print(f"āŒ Error reading README: {e}") return False return True def main(): """Main launcher function""" print_banner() # Check dependencies first if not check_dependencies(): print("\nāŒ Cannot proceed without required dependencies.") sys.exit(1) # Show options show_options() while True: try: print("\n" + "─" * 60) choice = input("Enter your choice (1-3, or 'q' to quit): ").strip().lower() if choice in ['q', 'quit', 'exit']: print("šŸ‘‹ Thank you for exploring our hackathon submission!") break elif choice == '1': if launch_gradio_demo(): break # Exit after Gradio demo ends elif choice == '2': run_system_demo() elif choice == '3': show_readme() else: print("āŒ Invalid choice. Please enter 1, 2, 3, or 'q'.") except KeyboardInterrupt: print("\n\nšŸ‘‹ Demo interrupted. Thank you for exploring our submission!") break except Exception as e: print(f"\nāŒ Unexpected error: {e}") print("Please try again or contact the developers.") if __name__ == "__main__": main()