Autobot::Tools::ImageGenerationTool
Inherits Autobot::Tools::Tool < Reference < Object
Tool for generating images from text prompts and sending them to users.
Follows the same send_callback + set_context pattern as MessageTool.
When the LLM calls generate_image(prompt), the tool:
- Calls the provider's image generation API (OpenAI or Gemini)
- Gets base64 image data back
- Constructs an OutboundMessage with MediaAttachment
- Publishes it via the send callback
Constants
DEFAULT_GEMINI_MODEL = "gemini-2.5-flash-image"
DEFAULT_OPENAI_MODEL = "gpt-image-1"
GEMINI_API_BASE = "https://generativelanguage.googleapis.com"
IMAGE_GEN_TIMEOUT = 120.seconds
Log = ::Log.for("tools.image_generation")
OPENAI_API_BASE = "https://api.openai.com"
VALID_SIZES = ["256x256", "512x512", "1024x1024", "1024x1536", "1536x1024", "auto"]
Constructors
Instance methods
description
Sourcename
Sourceparameters
Sourcesend_callback=(callback : SendCallback) : Nil
Source