pub trait InferenceEngine:
Send
+ Sync
+ 'static {
// Required methods
fn id(&self) -> String;
fn capabilities(&self) -> InferenceCapabilities;
fn list_models<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: InferenceProviderContext<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelDescriptor>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn stream_turn<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: InferenceTurnContext<'life1>,
request: AgentInferenceRequest,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<InferenceEvent, Error>> + Send>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
// Provided method
fn metadata(&self) -> InferenceProviderMetadata { ... }
}Required Methods§
fn id(&self) -> String
fn capabilities(&self) -> InferenceCapabilities
fn list_models<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: InferenceProviderContext<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelDescriptor>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn stream_turn<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: InferenceTurnContext<'life1>,
request: AgentInferenceRequest,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<InferenceEvent, Error>> + Send>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Provided Methods§
fn metadata(&self) -> InferenceProviderMetadata
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".