Skip to main content

Host

Trait Host 

Source
pub trait Host: Send {
    // Required methods
    fn infer(
        &mut self,
        model: InferencingModel,
        prompt: String,
        params: Option<InferencingParams>,
    ) -> impl Future<Output = Result<InferencingResult, Error>> + Send;
    fn generate_embeddings(
        &mut self,
        model: EmbeddingModel,
        text: Vec<String>,
    ) -> impl Future<Output = Result<EmbeddingsResult, Error>> + Send;
    fn convert_error(&mut self, err: Error) -> Result<Error>;
}

Required Methods§

Source

fn infer( &mut self, model: InferencingModel, prompt: String, params: Option<InferencingParams>, ) -> impl Future<Output = Result<InferencingResult, Error>> + Send

Perform inferencing using the provided model and prompt with the given optional params

Source

fn generate_embeddings( &mut self, model: EmbeddingModel, text: Vec<String>, ) -> impl Future<Output = Result<EmbeddingsResult, Error>> + Send

Generate embeddings for the supplied list of text

Source

fn convert_error(&mut self, err: Error) -> Result<Error>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<_T: Host + ?Sized + Send> Host for &mut _T

Source§

fn infer( &mut self, model: InferencingModel, prompt: String, params: Option<InferencingParams>, ) -> impl Future<Output = Result<InferencingResult, Error>> + Send

Perform inferencing using the provided model and prompt with the given optional params

Source§

fn generate_embeddings( &mut self, model: EmbeddingModel, text: Vec<String>, ) -> impl Future<Output = Result<EmbeddingsResult, Error>> + Send

Generate embeddings for the supplied list of text

Source§

fn convert_error(&mut self, err: Error) -> Result<Error>

Implementors§