Skip to main content

ModelOperations

Trait ModelOperations 

Source
pub trait ModelOperations: Send + Sync {
    // Required methods
    fn classify<'a>(
        &'a self,
        model: &'a ClassifierModel,
        context: &'a ClassifierContext,
        options: &'a ClassifyOptions,
    ) -> BoxFuture<'a, ClassifierResult>;
    fn generate_images<'a>(
        &'a self,
        model: &'a ImageModel,
        context: &'a ImagesContext,
        options: &'a ImagesOptions,
    ) -> BoxFuture<'a, AssistantImages>;
}
Expand description

The classifier and image APIs that a provider registered by an extension implements (pi-ai’s classify and generateImages of the provider).

Required Methods§

Source

fn classify<'a>( &'a self, model: &'a ClassifierModel, context: &'a ClassifierContext, options: &'a ClassifyOptions, ) -> BoxFuture<'a, ClassifierResult>

Classifies context with model. Failures are in the result.

Source

fn generate_images<'a>( &'a self, model: &'a ImageModel, context: &'a ImagesContext, options: &'a ImagesOptions, ) -> BoxFuture<'a, AssistantImages>

Generates images with model. Failures are in the result.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§