pub struct ImageGenTool { /* private fields */ }Expand description
image_gen — generate an image through the session’s own provider.
Constructed from the resolved crate::Config by
crate::tools::ToolRegistry::from_config, so it inherits exactly the
endpoint and credential the chat provider uses; it never reads a second
vendor’s configuration.
Implementations§
Source§impl ImageGenTool
impl ImageGenTool
Sourcepub fn new(
base_url: impl Into<String>,
api_key: Option<String>,
api_key_env: impl Into<String>,
) -> ImageGenTool
pub fn new( base_url: impl Into<String>, api_key: Option<String>, api_key_env: impl Into<String>, ) -> ImageGenTool
Build the tool from the session’s provider settings.
Sourcepub fn with_default_model(self, model: impl Into<String>) -> ImageGenTool
pub fn with_default_model(self, model: impl Into<String>) -> ImageGenTool
Override the default image model (the model argument still wins).
Trait Implementations§
Source§impl Clone for ImageGenTool
impl Clone for ImageGenTool
Source§fn clone(&self) -> ImageGenTool
fn clone(&self) -> ImageGenTool
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImageGenTool
impl Debug for ImageGenTool
Source§impl Tool for ImageGenTool
impl Tool for ImageGenTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
The built-in description. May be overridden via
crate::Config.Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema describing the tool’s input object.
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ImageGenTool: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ImageGenTool: 'async_trait,
Run the tool. Returns text to feed back to the model.
Source§fn structured_output(&self) -> bool
fn structured_output(&self) -> bool
Whether a successful textual result is also a complete JSON value
that protocol adapters should expose as structured output. Text
remains the model-facing representation, preserving compatibility.
Auto Trait Implementations§
impl Freeze for ImageGenTool
impl RefUnwindSafe for ImageGenTool
impl Send for ImageGenTool
impl Sync for ImageGenTool
impl Unpin for ImageGenTool
impl UnsafeUnpin for ImageGenTool
impl UnwindSafe for ImageGenTool
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