#!/bin/bash # Exit on error set -e # Check if Python 3.8 or higher is installed if ! command -v python3 &> /dev/null; then echo "Python 3 is not installed. Please install Python 3.8 or higher." exit 1 fi # Create and activate virtual environment if [ ! -d ".venv" ]; then echo "Creating virtual environment..." python3 -m venv .venv fi echo "Activating virtual environment..." source .venv/bin/activate # Upgrade pip echo "Upgrading pip..." pip install --upgrade pip # Install dependencies echo "Installing dependencies..." pip install -r requirements.txt # Install pre-commit hooks echo "Setting up pre-commit hooks..." pre-commit install # Create .env file if it doesn't exist 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 # Create .env.example if it doesn't exist 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!"