pub struct ImageGenerateTool { /* private fields */ }Expand description
Builtin tool that generates images from a text prompt via the OpenRouter image API.
Sends a request to the configured model (default: google/gemini-3.1-flash-image-preview)
and returns the result as a base64-encoded inline image block marked with the
[IMAGE:base64:...] prefix so downstream handlers can decode it. Requires an
OPENROUTER_API_KEY environment variable; construction fails gracefully via
try_new if the HTTP client cannot be initialised.
Implementations§
Source§impl ImageGenerateTool
impl ImageGenerateTool
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an ImageGenerateTool.
Panics if the HTTP client cannot be built. Use ImageGenerateTool::try_new
if you need to handle the error.
Trait Implementations§
Source§impl Default for ImageGenerateTool
impl Default for ImageGenerateTool
Source§impl Tool for ImageGenerateTool
impl Tool for ImageGenerateTool
Source§fn definition(&self) -> ToolDefinition
fn definition(&self) -> ToolDefinition
Return the tool’s definition (name, description, input schema) for the LLM.
Auto Trait Implementations§
impl !RefUnwindSafe for ImageGenerateTool
impl !UnwindSafe for ImageGenerateTool
impl Freeze for ImageGenerateTool
impl Send for ImageGenerateTool
impl Sync for ImageGenerateTool
impl Unpin for ImageGenerateTool
impl UnsafeUnpin for ImageGenerateTool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more