Prerequisites
You need to install thegoogle-genai and Pillow libraries.
GOOGLE_API_KEY environment variable. You can obtain an API key from Google AI Studio.
Example
The following agent will use Nano Banana to generate an image based on a text prompt.nano_banana_tools.py
Toolkit Params
| Parameter | Type | Default | Description |
|---|---|---|---|
model | str | "gemini-2.5-flash-image" | The Nano Banana model to use |
aspect_ratio | str | "1:1" | Image aspect ratio. Supported: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 |
api_key | str | None | The Google API key for authentication |
enable_create_image | bool | True | Enable the create image functionality |
Toolkit Functions
| Function | Description |
|---|---|
create_image | Generates an image based on a text prompt |
Developer Resources
- View Tools