File size: 1,126 Bytes
7dfe46c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import subprocess
import sys
from pathlib import Path

def main():
    """Launch the Streamlit demo application."""
    # Get the directory containing this script
    script_dir = Path(__file__).parent
    demo_path = script_dir / "src" / "rag_demo.py"
    
    if not demo_path.exists():
        print(f"Error: Demo file not found at {demo_path}")
        sys.exit(1)
    
    # Launch Streamlit
    try:
        print("🏭 Launching Manufacturing RAG Agent Demo...")
        print(f"πŸ“ Demo path: {demo_path}")
        print("🌐 The demo will open in your default web browser")
        print("πŸ›‘ Press Ctrl+C to stop the demo")
        print("-" * 50)
        
        subprocess.run([
            sys.executable, "-m", "streamlit", "run", str(demo_path),
            "--server.port", "8501",
            "--server.address", "localhost",
            "--browser.gatherUsageStats", "false"
        ])
        
    except KeyboardInterrupt:
        print("\nπŸ›‘ Demo stopped by user")
    except Exception as e:
        print(f"❌ Failed to launch demo: {e}")
        sys.exit(1)

if __name__ == "__main__":
    main()