Skip to main content

VideoModel

Trait VideoModel 

Source
pub trait VideoModel:
    Send
    + Sync
    + Debug {
    // Required methods
    fn provider(&self) -> &str;
    fn model_id(&self) -> &str;
    fn do_generate<'life0, 'async_trait>(
        &'life0 self,
        options: VideoOptions,
    ) -> Pin<Box<dyn Future<Output = Result<VideoResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn specification_version(&self) -> &'static str { ... }
    fn max_videos_per_call<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Option<u32>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Contract every video-generation model implements.

Required Methods§

Source

fn provider(&self) -> &str

Provider id, e.g. "xai".

Source

fn model_id(&self) -> &str

Provider-specific model id, e.g. "grok-2-video".

Source

fn do_generate<'life0, 'async_trait>( &'life0 self, options: VideoOptions, ) -> Pin<Box<dyn Future<Output = Result<VideoResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Generate videos.

§Errors

Returns a crate::ProviderError when the upstream call fails, the generation job times out, or the response is malformed.

Provided Methods§

Source

fn specification_version(&self) -> &'static str

Specification version (currently "v4").

Source

fn max_videos_per_call<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<u32>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Maximum videos that can be requested per call.

Most video models only support n=1 due to computational cost; the default returns Some(1).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§