1"""🔧 Example: Using the GeminiTools Toolkit for Image Generation
2
3Make sure you have set the GOOGLE_API_KEY environment variable.
4Example prompts to try:
5- "Create a surreal painting of a floating city in the clouds at sunset"
6- "Generate a photorealistic image of a cozy coffee shop interior"
7- "Design a cute cartoon mascot for a tech startup, vector style"
8- "Create an artistic portrait of a cyberpunk samurai in a rainy city"
9
10"""
11
12from kern.agent import Agent
13from kern.models.openai import OpenAIResponses
14from kern.tools.models.gemini import GeminiTools
15from kern.utils.media import save_base64_data
16
17agent = Agent(
18 model=OpenAIResponses(id="gpt-5.2"),
19 tools=[GeminiTools()],
20)
21
22response = agent.run(
23 "Create an artistic portrait of a cyberpunk samurai in a rainy city",
24)
25if response and response.images:
26 save_base64_data(str(response.images[0].content), "tmp/cyberpunk_samurai.png")