File size: 1,844 Bytes
efed2d6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

# AutoSEO Engine - Deployment Script

set -e  # Exit on any error

echo "AutoSEO Engine - Deployment Script"
echo "=================================="

# Check if Python 3.9+ is available
if ! command -v python3 &> /dev/null; then
    echo "Error: Python3 is not installed"
    exit 1
fi

PYTHON_VERSION=$(python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')

# Check if Python 3.9+ is available by comparing major.minor versions properly
PYTHON_MAJOR=$(python3 -c 'import sys; print(sys.version_info.major)')
PYTHON_MINOR=$(python3 -c 'import sys; print(sys.version_info.minor)')

if [[ $PYTHON_MAJOR -lt 3 ]] || [[ $PYTHON_MAJOR -eq 3 && $PYTHON_MINOR -lt 9 ]]; then
    echo "Error: Python 3.9 or higher is required. Current version: $PYTHON_VERSION"
    exit 1
fi

echo "Python version: $PYTHON_VERSION"

# Check if pip is available
if ! command -v pip3 &> /dev/null; then
    echo "Installing pip..."
    python3 -m ensurepip --upgrade
fi

# Install dependencies
echo "Installing dependencies..."
pip3 install -r requirements.txt

# Create necessary directories
echo "Creating directories..."
mkdir -p logs
mkdir -p backups
mkdir -p data

# Create config file if it doesn't exist
if [ ! -f "config/config.yaml" ]; then
    echo "Creating default config file..."
    mkdir -p config
    cat << EOF > config/config.yaml
# AutoSEO Engine Configuration

database:
  url: "sqlite:///./autoseo.db"
  pool_size: 5

agents:
  max_iterations: 10
  timeout_seconds: 300
  
llm:
  model_name: "local-model"
  temperature: 0.7
  
monitoring:
  log_level: "INFO"
  enable_metrics: true
EOF
fi

echo "Setup complete!"
echo ""
echo "To start the AutoSEO Engine, run:"
echo "  python3 main.py"
echo ""
echo "For background execution:"
echo "  nohup python3 main.py > logs/autoseo.log 2>&1 &"
echo ""