Skip to content

Configuration

The AP3 SDK requires minimal configuration to get started. Most settings are optional and have sensible defaults.

Google AI Studio API Key

For agents using Google's Gemini models, you'll need an API key.

1. Obtain an API Key:

Visit Google AI Studio and create a new API key.

2. Configure the Key:

Create a .env file in your project root:

cp .env.example .env

Add your key to the .env file:

GOOGLE_API_KEY="your-api-key-here"

3. Load in Your Application:

from dotenv import load_dotenv
import os

load_dotenv()
api_key = os.getenv('GOOGLE_API_KEY')

LLM configurations

LLM Model Selection

# .env file
# Example :
MODEL_NAME="gemini-2.0-flash"  # Default
# MODEL_NAME="gemini-2.5-flash"
# MODEL_NAME="gemini-1.5-pro"

Logging

import logging

logging.basicConfig(level=logging.INFO)   # Default
logging.basicConfig(level=logging.DEBUG)  # Verbose debugging

Project Structure

A typical project layout:

your-project/
├── .env                 # Environment variables (gitignored)
├── .env.example        
├── agents/
│   └── my_agent.py
└── main.py

Next Steps

  1. Run the Quick Start - Test your setup
  2. Explore Examples - Learn from working code