pub struct GoogleImageModel { /* private fields */ }Expand description
Image model backed by a Gemini image-capable language model.
Implementations§
Source§impl GoogleImageModel
impl GoogleImageModel
Sourcepub fn new(config: SharedConfig, model_id: impl Into<ModelId>) -> Self
pub fn new(config: SharedConfig, model_id: impl Into<ModelId>) -> Self
Creates the model.
Sourcepub fn with_max_images_per_call(self, max: usize) -> Self
pub fn with_max_images_per_call(self, max: usize) -> Self
Overrides the advertised maximum; Gemini still rejects n > 1.
Sourcepub fn prepare_call(
&self,
options: &ImageOptions,
) -> Result<(CallOptions, Vec<Warning>), ProviderError>
pub fn prepare_call( &self, options: &ImageOptions, ) -> Result<(CallOptions, Vec<Warning>), ProviderError>
Builds the language model call for options.
§Errors
Returns ProviderError::InvalidArgument for non-Gemini model ids,
masks and n > 1.
Trait Implementations§
Source§impl Clone for GoogleImageModel
impl Clone for GoogleImageModel
Source§fn clone(&self) -> GoogleImageModel
fn clone(&self) -> GoogleImageModel
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 GoogleImageModel
impl Debug for GoogleImageModel
Source§impl ImageModel for GoogleImageModel
impl ImageModel for GoogleImageModel
Source§fn provider(&self) -> &ProviderId
fn provider(&self) -> &ProviderId
Provider identifier.
Source§fn max_images_per_call(&self) -> Option<usize>
fn max_images_per_call(&self) -> Option<usize>
Maximum number of images per call, or
None when unknown (treated as 1).Source§async fn do_generate(
&self,
options: ImageOptions,
) -> Result<ImageResult, ProviderError>
async fn do_generate( &self, options: ImageOptions, ) -> Result<ImageResult, ProviderError>
Generates
options.n images.Auto Trait Implementations§
impl !RefUnwindSafe for GoogleImageModel
impl !UnwindSafe for GoogleImageModel
impl Freeze for GoogleImageModel
impl Send for GoogleImageModel
impl Sync for GoogleImageModel
impl Unpin for GoogleImageModel
impl UnsafeUnpin for GoogleImageModel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DynImageModel for Twhere
T: ImageModel,
impl<T> DynImageModel for Twhere
T: ImageModel,
Source§fn provider(&self) -> &ProviderId
fn provider(&self) -> &ProviderId
See
ImageModel::provider.Source§fn model_id(&self) -> &ModelId
fn model_id(&self) -> &ModelId
See
ImageModel::model_id.