|
#!/bin/bash |
|
|
|
|
|
set -e |
|
|
|
|
|
if ! command -v python3 &> /dev/null; then |
|
echo "Python 3 is not installed. Please install Python 3.8 or higher." |
|
exit 1 |
|
fi |
|
|
|
|
|
if [ ! -d ".venv" ]; then |
|
echo "Creating virtual environment..." |
|
python3 -m venv .venv |
|
fi |
|
|
|
echo "Activating virtual environment..." |
|
source .venv/bin/activate |
|
|
|
|
|
echo "Upgrading pip..." |
|
pip install --upgrade pip |
|
|
|
|
|
echo "Installing dependencies..." |
|
pip install -r requirements.txt |
|
|
|
|
|
echo "Setting up pre-commit hooks..." |
|
pre-commit install |
|
|
|
|
|
if [ ! -f ".env" ]; then |
|
echo "Creating .env file..." |
|
echo "PYTHONPATH=$(pwd)/src" > .env |
|
echo "Please update .env with your API keys and other configuration" |
|
fi |
|
|
|
|
|
if [ ! -f ".env.example" ]; then |
|
echo "Creating .env.example file..." |
|
cat > .env.example << EOL |
|
# API Keys |
|
OPENAI_API_KEY=your_openai_api_key |
|
GOOGLE_API_KEY=your_google_api_key |
|
HUGGINGFACE_API_KEY=your_huggingface_api_key |
|
|
|
# Database Configuration |
|
SUPABASE_URL=your_supabase_url |
|
SUPABASE_KEY=your_supabase_key |
|
|
|
# Other Configuration |
|
PYTHONPATH=$(pwd)/src |
|
EOL |
|
fi |
|
|
|
echo "Installation complete! The gagent package is now available in your Python environment." |
|
echo "You can import it using: from gagent import GAIAAgent, GeminiAgent" |
|
echo "Don't forget to update your .env file with the necessary API keys and configuration!" |
|
|