Skip to main content

ListModelsHandler

Trait ListModelsHandler 

Source
pub trait ListModelsHandler:
    Send
    + Sync
    + 'static {
    // Required method
    fn list_models<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Model>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Custom handler for Client::list_models.

Implementations override the default models.list RPC, returning a caller-supplied catalog of models. Set via ClientOptions::on_list_models.

Implementations must be Send + Sync because Client is shared across tasks. Errors returned by list_models are propagated from Client::list_models unchanged.

Required Methods§

Source

fn list_models<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Model>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the list of available models.

Implementors§