Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python3 | |
| """ | |
| Customer Profile Analysis Dashboard App. | |
| This app provides a Gradio UI for viewing and searching customer profile analyses | |
| from the customer_profile_analyses MongoDB collection. | |
| """ | |
| import click | |
| from second_brain_online.application.ui.customer_profile_ui import CustomerProfileUI | |
| def main(host: str, port: int, share: bool, debug: bool) -> None: | |
| """Launch the Customer Profile Analysis Dashboard. | |
| This dashboard allows you to: | |
| - View all customer profile analyses in a searchable table | |
| - Search by company name, customer ID, key changes, recommendations, or email content | |
| - View detailed analysis for each customer | |
| - See statistics about the analyses | |
| Args: | |
| host: Host to run the server on | |
| port: Port to run the server on | |
| share: Create a public link for the interface | |
| debug: Enable debug mode | |
| """ | |
| print("π Starting Customer Profile Analysis Dashboard...") | |
| print(f"π Server will be available at: http://{host}:{port}") | |
| if share: | |
| print("π Creating public link...") | |
| if debug: | |
| print("π Debug mode enabled") | |
| try: | |
| # Initialize the UI | |
| ui = CustomerProfileUI() | |
| # Launch the interface | |
| ui.launch( | |
| server_name=host, | |
| server_port=port, | |
| share=share, | |
| debug=debug, | |
| show_error=True, | |
| quiet=False | |
| ) | |
| except Exception as e: | |
| print(f"β Failed to start the dashboard: {e}") | |
| raise | |
| if __name__ == "__main__": | |
| main() | |