pub trait Host: Send {
// Required methods
fn infer<'life0, 'async_trait>(
&'life0 mut self,
model: InferencingModel,
prompt: String,
params: Option<InferencingParams>,
) -> Pin<Box<dyn Future<Output = Result<InferencingResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn generate_embeddings<'life0, 'async_trait>(
&'life0 mut self,
model: EmbeddingModel,
text: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<EmbeddingsResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn convert_error(&mut self, err: Error) -> Result<Error>;
}
Required Methods§
Sourcefn infer<'life0, 'async_trait>(
&'life0 mut self,
model: InferencingModel,
prompt: String,
params: Option<InferencingParams>,
) -> Pin<Box<dyn Future<Output = Result<InferencingResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn infer<'life0, 'async_trait>(
&'life0 mut self,
model: InferencingModel,
prompt: String,
params: Option<InferencingParams>,
) -> Pin<Box<dyn Future<Output = Result<InferencingResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform inferencing using the provided model and prompt with the given optional params
Sourcefn generate_embeddings<'life0, 'async_trait>(
&'life0 mut self,
model: EmbeddingModel,
text: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<EmbeddingsResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_embeddings<'life0, 'async_trait>(
&'life0 mut self,
model: EmbeddingModel,
text: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<EmbeddingsResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate embeddings for the supplied list of text
fn convert_error(&mut self, err: Error) -> Result<Error>
Implementations on Foreign Types§
Source§impl<_T: Host + ?Sized + Send> Host for &mut _T
impl<_T: Host + ?Sized + Send> Host for &mut _T
Source§fn infer<'life0, 'async_trait>(
&'life0 mut self,
model: InferencingModel,
prompt: String,
params: Option<InferencingParams>,
) -> Pin<Box<dyn Future<Output = Result<InferencingResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn infer<'life0, 'async_trait>(
&'life0 mut self,
model: InferencingModel,
prompt: String,
params: Option<InferencingParams>,
) -> Pin<Box<dyn Future<Output = Result<InferencingResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform inferencing using the provided model and prompt with the given optional params
Source§fn generate_embeddings<'life0, 'async_trait>(
&'life0 mut self,
model: EmbeddingModel,
text: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<EmbeddingsResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_embeddings<'life0, 'async_trait>(
&'life0 mut self,
model: EmbeddingModel,
text: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<EmbeddingsResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate embeddings for the supplied list of text