pub trait EmbeddingService:
Send
+ Sync
+ 'static {
type EmbedStreamStream: Stream<Item = Result<EmbedResponse, Status>> + Send + 'static;
// Required methods
fn embed<'life0, 'async_trait>(
&'life0 self,
request: Request<EmbedRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<EmbedResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn health<'life0, 'async_trait>(
&'life0 self,
request: Request<HealthRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<HealthResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn model_info<'life0, 'async_trait>(
&'life0 self,
request: Request<ModelInfoRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ModelInfoResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn embed_stream<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<EmbedRequest>>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::EmbedStreamStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Generated trait containing gRPC methods that should be implemented for use with EmbeddingServiceServer.
Required Associated Types§
Sourcetype EmbedStreamStream: Stream<Item = Result<EmbedResponse, Status>> + Send + 'static
type EmbedStreamStream: Stream<Item = Result<EmbedResponse, Status>> + Send + 'static
Server streaming response type for the EmbedStream method.
Required Methods§
Sourcefn embed<'life0, 'async_trait>(
&'life0 self,
request: Request<EmbedRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<EmbedResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn embed<'life0, 'async_trait>(
&'life0 self,
request: Request<EmbedRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<EmbedResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Embed a batch of texts in a single round-trip.
Sourcefn health<'life0, 'async_trait>(
&'life0 self,
request: Request<HealthRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<HealthResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health<'life0, 'async_trait>(
&'life0 self,
request: Request<HealthRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<HealthResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check whether the model is loaded and the service is ready.
Sourcefn model_info<'life0, 'async_trait>(
&'life0 self,
request: Request<ModelInfoRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ModelInfoResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn model_info<'life0, 'async_trait>(
&'life0 self,
request: Request<ModelInfoRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ModelInfoResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return metadata about the currently loaded model.
Sourcefn embed_stream<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<EmbedRequest>>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::EmbedStreamStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn embed_stream<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<EmbedRequest>>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::EmbedStreamStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Bidirectional streaming embed for large or continuous workloads.