repo_description: OpenChatBI is an intelligent chat-based BI tool powered by large language models, designed to help users query, analyze, and visualize data through natural language conversations. It uses LangGraph and LangChain to build chat agent and workflows that support natural language to SQL conversion and data analysis.
repo_topics: agent ai analytics bi database datawarehouse gpt langchain langgraph llm nlp text2sql
code: #!/usr/bin/env python3
  """
  Launch script for the Streamlit-based OpenChatBI interface.
  
  Usage:
      python run_streamlit_ui.py
  
  This will start the Streamlit server on http://localhost:8501
  """
  
  import os
  import subprocess
  import sys
  
  
  def main():
      """Launch the Streamlit UI"""
      # Change to the project directory
      project_dir = os.path.dirname(os.path.abspath(__file__))
      os.chdir(project_dir)
  
      print("🚀 Starting OpenChatBI Streamlit UI...")
      print("📍 URL: http://localhost:8501")
      print("⏹️  Press Ctrl+C to stop the server")
      print("-" * 50)
  
      try:
          # Run streamlit with the new UI file
          subprocess.run(
              [
                  sys.executable,
                  "-m",
                  "streamlit",
                  "run",
                  "sample_ui/streamlit_ui.py",
                  "--server.port=8501",
                  "--server.address=localhost",
              ],
              check=True,
          )
      except KeyboardInterrupt:
          print("\n👋 Stopping Streamlit server...")
      except subprocess.CalledProcessError as e:
          print(f"❌ Error starting Streamlit: {e}")
          print("\n💡 Make sure Streamlit is installed:")
          print("   pip install streamlit")
      except FileNotFoundError:
          print("❌ Python or Streamlit not found")
          print("\n💡 Make sure Python and Streamlit are installed:")
          print("   pip install streamlit")
  
  
  if __name__ == "__main__":
      main()
  