Skip to content

Installation

This guide will help you install and set up the Gemini Agent Framework.

Requirements

  • Python 3.8 or higher
  • pip (Python package installer)
  • A Google Generative AI API key

Installation Methods

Using pip

The simplest way to install the framework is using pip:

pip install gemini-agent-framework

From Source

If you want to install from source:

  1. Clone the repository:

    git clone https://github.com/m7mdony/gemini-agent-framework.git
    cd gemini-agent-framework
    

  2. Install the package:

    pip install -e .
    

Development Installation

For development, install with development dependencies:

pip install -e ".[dev]"

This will install additional tools for development: - pytest for testing - black for code formatting - isort for import sorting - mypy for type checking - flake8 for linting

API Key Setup

  1. Get your API key from Google AI Studio

  2. Create a .env file in your project root:

    GEMINI_API_KEY=your-api-key-here
    

  3. Load the API key in your code:

    from dotenv import load_dotenv
    load_dotenv()
    

Verification

To verify the installation, run:

from gemini_agent import Agent

# Create an agent instance
agent = Agent(api_key="your-api-key")

# Test the agent
response = agent.prompt("Hello, world!")
print(response)

Troubleshooting

Common Issues

  1. API Key Not Found
  2. Make sure your .env file exists and contains the correct API key
  3. Check that you're loading the environment variables correctly

  4. Import Error

  5. Verify that the package is installed correctly
  6. Check your Python version (must be 3.8 or higher)

  7. Dependency Issues

  8. Try reinstalling the package
  9. Check for conflicting packages

Getting Help

If you encounter any issues: - Check the GitHub Issues - Create a new issue with details about your problem