Skip to main content

AsyncImageDescriber

Trait AsyncImageDescriber 

Source
pub trait AsyncImageDescriber: Send + Sync {
    // Required method
    fn describe<'a>(
        &'a self,
        image_bytes: &'a [u8],
        mime_type: &'a str,
        prompt: &'a str,
    ) -> AsyncDescribeFuture<'a>;
}
Expand description

Async trait for generating image descriptions using an LLM or other backend.

This is the async counterpart of ImageDescriber. It uses Pin<Box<dyn Future>> for dyn-compatibility (async fn in traits is not dyn-safe).

Requires the async feature.

Required Methods§

Source

fn describe<'a>( &'a self, image_bytes: &'a [u8], mime_type: &'a str, prompt: &'a str, ) -> AsyncDescribeFuture<'a>

Describe the given image asynchronously.

  • image_bytes: raw image data (PNG, JPEG, etc.)
  • mime_type: MIME type of the image (e.g., "image/png")
  • prompt: instruction for the LLM (e.g., “Describe this image concisely”)

Implementors§

Source§

impl AsyncImageDescriber for AsyncGeminiDescriber

Available on crate feature async-gemini only.