Skip to main content

ModelSource

Trait ModelSource 

Source
pub trait ModelSource {
    // Required method
    async fn list(
        &self,
        endpoint: &str,
        api_key: &str,
        protocol: ApiProtocol,
    ) -> Result<Vec<Model>, ListError>;
}
Expand description

Where the wizard gets a model list.

A trait so the wizard can be driven by a stub: the alternative is a wizard test suite that makes real network calls, which would be slow, offline- hostile, and dependent on somebody’s plan still including a given model.

Required Methods§

Source

async fn list( &self, endpoint: &str, api_key: &str, protocol: ApiProtocol, ) -> Result<Vec<Model>, ListError>

List the models endpoint serves.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§