File size: 1,013 Bytes
dc4e6da | 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 | #!/bin/bash
# Start the DocGenie API server
# Note: All dependencies should be installed via 'uv sync' or 'pip install -e .'
echo "Starting DocGenie API..."
# Check if .env file exists
if [ ! -f .env ]; then
echo "Warning: .env file not found. Using .env.example as template."
echo "Please copy .env.example to .env and set your ANTHROPIC_API_KEY"
if [ -f .env.example ]; then
cp .env.example .env
echo "Created .env file from .env.example"
fi
fi
# Load environment variables
if [ -f .env ]; then
export $(cat .env | grep -v '^#' | xargs)
fi
# Check if ANTHROPIC_API_KEY is set
if [ -z "$ANTHROPIC_API_KEY" ]; then
echo "Error: ANTHROPIC_API_KEY not set in .env file"
exit 1
fi
# Default values
HOST=${API_HOST:-0.0.0.0}
PORT=${API_PORT:-8000}
WORKERS=${API_WORKERS:-4}
echo "Configuration:"
echo " Host: $HOST"
echo " Port: $PORT"
echo " Workers: $WORKERS"
echo ""
# Start the API
uvicorn main:app --host $HOST --port $PORT --workers $WORKERS --reload
|