-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
107 lines (97 loc) · 2.48 KB
/
Copy pathstart.sh
File metadata and controls
107 lines (97 loc) · 2.48 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash
# Quick-start script for the NLP-to-SQL Agentic Pipeline
# Run with: bash start.sh
set -e
echo "🚀 NLP-to-SQL Agentic Pipeline Setup"
echo "===================================="
# Check Python
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 not found. Please install Python 3.9+"
exit 1
fi
# Create virtualenv if it doesn't exist
if [ ! -d ".venv" ]; then
echo "📦 Creating virtual environment..."
python3 -m venv .venv
source .venv/bin/activate
echo "✓ Virtual environment created"
else
echo "✓ Virtual environment already exists"
source .venv/bin/activate
fi
# Install dependencies
echo "📥 Installing dependencies..."
pip install -q -r requirements.txt 2>&1 | tail -5
echo "✓ Dependencies installed"
# Create sample database
if [ ! -f "data.db" ]; then
echo "🗄️ Creating sample database..."
python3 setup_sample_db.py
else
echo "✓ Sample database already exists"
fi
# Check API key
if [ -z "$OPENAI_API_KEY" ]; then
echo ""
echo "⚠️ OPENAI_API_KEY not set!"
echo "Set it with: export OPENAI_API_KEY='sk-...'"
echo ""
read -p "Continue without API key? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
# Menu
echo ""
echo "What would you like to do?"
echo " 1. Run tests (pytest)"
echo " 2. Run dry-run example"
echo " 3. Run integration examples"
echo " 4. Run Streamlit app"
echo " 5. All of the above"
echo ""
read -p "Choose option (1-5): " choice
case $choice in
1)
echo ""
echo "🧪 Running tests..."
python3 -m pytest test_agent.py -v
;;
2)
echo ""
echo "▶️ Running dry-run example..."
python3 dry_run.py
;;
3)
echo ""
echo "📚 Running integration examples..."
python3 integration_examples.py
;;
4)
echo ""
echo "🎨 Starting Streamlit app..."
echo " Open http://localhost:8501"
streamlit run app.py
;;
5)
echo ""
echo "🧪 Running tests..."
python3 -m pytest test_agent.py -v
echo ""
echo "▶️ Running dry-run example..."
python3 dry_run.py
echo ""
echo "📚 Running integration examples..."
python3 integration_examples.py
echo ""
echo "🎨 Starting Streamlit app..."
streamlit run app.py
;;
*)
echo "Invalid option"
exit 1
;;
esac
echo ""
echo "✅ Done!"