Documentation Index
Fetch the complete documentation index at: https://agno-v2-rbac-doc-update.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Code
cookbook/11_models/google/gemini/imagen_tool.py
Documentation Index
Fetch the complete documentation index at: https://agno-v2-rbac-doc-update.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
"""🔧 Example: Using the GeminiTools Toolkit for Image Generation
Make sure you have set the GOOGLE_API_KEY environment variable.
Example prompts to try:
- "Create a surreal painting of a floating city in the clouds at sunset"
- "Generate a photorealistic image of a cozy coffee shop interior"
- "Design a cute cartoon mascot for a tech startup, vector style"
- "Create an artistic portrait of a cyberpunk samurai in a rainy city"
"""
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.models.gemini import GeminiTools
from agno.utils.media import save_base64_data
agent = Agent(
model=OpenAIResponses(id="gpt-5.2"),
tools=[GeminiTools()],
)
response = agent.run(
"Create an artistic portrait of a cyberpunk samurai in a rainy city",
)
if response and response.images:
save_base64_data(str(response.images[0].content), "tmp/cyberpunk_samurai.png")
Was this page helpful?