pub trait Provider: Send + Sync {
// Required methods
fn descriptor(&self) -> ProviderDescriptor;
fn list_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelInfo>, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: Request<'life1>,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<Result<ProviderEvent, ProviderError>>, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
// Provided methods
fn capabilities(&self) -> ProviderCapabilities { ... }
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
request: Request<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Response, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
fn compact<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: CompactionRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<CompactionResponse, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
fn summarize_memories<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: MemorySummarizeRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<MemorySummarizeResponse, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
}Expand description
Transport-neutral interface implemented by model providers.
Required Methods§
Sourcefn descriptor(&self) -> ProviderDescriptor
fn descriptor(&self) -> ProviderDescriptor
Returns identifying metadata for the provider instance.
Sourcefn list_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelInfo>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn list_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelInfo>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Lists models available from the provider.
Sourcefn stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: Request<'life1>,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<Result<ProviderEvent, ProviderError>>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: Request<'life1>,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<Result<ProviderEvent, ProviderError>>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Streams a model response for the given request.
Provided Methods§
Sourcefn capabilities(&self) -> ProviderCapabilities
fn capabilities(&self) -> ProviderCapabilities
Returns feature flags supported by this provider instance.
Sourcefn send<'life0, 'life1, 'async_trait>(
&'life0 self,
request: Request<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Response, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
request: Request<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Response, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sends a request and collects the full response in memory.
Sourcefn compact<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: CompactionRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<CompactionResponse, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn compact<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: CompactionRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<CompactionResponse, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Compacts transcript history using a provider-native endpoint when supported.
Sourcefn summarize_memories<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: MemorySummarizeRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<MemorySummarizeResponse, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn summarize_memories<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: MemorySummarizeRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<MemorySummarizeResponse, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Summarizes raw trace memories using a provider-native implementation when supported.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".