-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·45 lines (37 loc) · 1.24 KB
/
start.sh
File metadata and controls
executable file
·45 lines (37 loc) · 1.24 KB
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
#!/bin/bash
# Intrabot-AI Startup Script
echo "🤖 Starting Intrabot-AI..."
# Check if virtual environment exists
if [ ! -d "venv" ]; then
echo "📦 Setting up virtual environment..."
python3 -m venv venv
fi
# Activate virtual environment
echo "🔧 Activating virtual environment..."
source venv/bin/activate
# Install/upgrade dependencies
echo "⬇️ Installing dependencies..."
pip install -r requirements.txt
# Check if .env file exists
if [ ! -f ".env" ]; then
echo "⚠️ .env file not found. Creating from template..."
cp .env.example .env
echo "📝 Please edit .env file with your actual API keys before running the server."
echo " Especially set your GEMINI_API_KEY"
fi
# Initialize database if needed
if [ ! -d "offline-org-chatbot/.chromadb" ]; then
echo "🗄️ Initializing database..."
python init_db.py
else
echo "✅ Database already exists"
fi
# Start the FastAPI server
echo "🚀 Starting FastAPI server..."
echo " Server will be available at: http://127.0.0.1:8000"
echo " API documentation at: http://127.0.0.1:8000/docs"
echo " Frontend interface at: http://127.0.0.1:8000/static/"
echo ""
echo "Press Ctrl+C to stop the server"
echo ""
uvicorn api:app --host 127.0.0.1 --port 8000 --reload