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:
-
Clone the repository:
git clone https://github.com/m7mdony/gemini-agent-framework.git cd gemini-agent-framework -
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¶
-
Get your API key from Google AI Studio
-
Create a
.envfile in your project root:GEMINI_API_KEY=your-api-key-here -
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¶
- API Key Not Found
- Make sure your
.envfile exists and contains the correct API key -
Check that you're loading the environment variables correctly
-
Import Error
- Verify that the package is installed correctly
-
Check your Python version (must be 3.8 or higher)
-
Dependency Issues
- Try reinstalling the package
- Check for conflicting packages
Getting Help¶
If you encounter any issues: - Check the GitHub Issues - Create a new issue with details about your problem