-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·50 lines (39 loc) · 1.99 KB
/
run.sh
File metadata and controls
executable file
·50 lines (39 loc) · 1.99 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
46
47
48
49
50
#!/bin/bash
# ──────────────────────────────────────────────────────────────────
# Self-Extending Agent UI — Startup Script
# Starts the FastAPI server at http://localhost:8000
# ──────────────────────────────────────────────────────────────────
set -e
# Navigate to project root
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
# Check Ollama is running
# Kill existing uvicorn on port 8000
echo "🧹 Cleaning up port 8000..."
lsof -i :8000 -t | xargs kill -9 2>/dev/null || true
sleep 2
# Set environment variables for Ollama
# Set your API keys in dev_assistant_app/.env instead of here
# export GEMINI_API_KEY="your-gemini-api-key-here" # Set in .env
source dev_assistant_app/.env 2>/dev/null || true
export GEMINI_API_KEY="${GEMINI_API_KEY:-your-gemini-api-key-here}"
# Check if virtual environment exists
if [ -d ".venv" ]; then
echo "🐍 Activating virtual environment..."
source .venv/bin/activate
fi
# Install dependencies if needed
echo "📦 Installing/checking dependencies..."
pip3 install -q -r requirements.txt 2>/dev/null || pip install -q -r requirements.txt 2>/dev/null || true
# Find uvicorn
UVICORN_BIN=$(which uvicorn 2>/dev/null || echo "uvicorn")
echo ""
echo "🚀 Starting Self-Extending Agent UI"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo " UI: http://localhost:8000"
echo " Skills: Scanning from dev_assistant_app/skills/"
echo " Model: Gemini 2.5 Flash"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Start the server
"$UVICORN_BIN" backend.main:app --host 0.0.0.0 --port 8000 --reload --log-level warning