Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python3 | |
| """ | |
| Main entry point for the Agentic Browser application on Hugging Face Spaces. | |
| """ | |
| import os | |
| import sys | |
| import streamlit as st | |
| # Add the current directory to the Python path | |
| current_dir = os.path.dirname(os.path.abspath(__file__)) | |
| if current_dir not in sys.path: | |
| sys.path.insert(0, current_dir) | |
| # Add the src directory to the Python path | |
| src_dir = os.path.join(current_dir, 'src') | |
| if src_dir not in sys.path: | |
| sys.path.insert(0, src_dir) | |
| # Configure Streamlit page | |
| st.set_page_config( | |
| page_title="π€ Agentic Browser", | |
| page_icon="π€", | |
| layout="wide", | |
| initial_sidebar_state="expanded" | |
| ) | |
| # Import the streamlit app components and run directly | |
| try: | |
| # Import all the UI components from streamlit_app | |
| import streamlit_app | |
| # The streamlit_app.py file contains the UI code that runs automatically | |
| # when imported, so we don't need to call a function here | |
| except ImportError as e: | |
| st.error(f"Failed to import streamlit app: {e}") | |
| st.info("Please check that all required files are present.") | |
| except Exception as e: | |
| st.error(f"An error occurred: {e}") | |
| st.info("Please refresh the page or contact support.") | |