File size: 1,186 Bytes
422e708
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python3
"""
Hugging Face Space app for Conversation Analysis Dashboard.

This app displays conversation analysis results in a tabular format,
showing insights, summaries, and follow-up emails for all conversations
from the test_intercom_data collection.
"""

import os
import sys
from pathlib import Path

# Add paths
sys.path.append('.')
sys.path.append('src')

from second_brain_online.application.ui.conversation_analysis_ui import ConversationAnalysisUI

def main():
    """Main function for HF Space deployment."""
    print("πŸš€ Starting Conversation Analysis Dashboard...")
    print("πŸ“Š Loading conversation analysis data from MongoDB...")
    
    try:
        # Initialize UI
        ui = ConversationAnalysisUI()
        
        print("βœ… UI initialized successfully")
        print("🌐 Launching Gradio interface...")
        
        # Launch the interface
        ui.launch(
            server_name="0.0.0.0",
            server_port=7860,
            share=False,
            show_error=True
        )
        
    except Exception as e:
        print(f"❌ Error starting the application: {e}")
        raise

if __name__ == "__main__":
    main()