Skip to main content

Provider

Trait Provider 

Source
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§

Source

fn descriptor(&self) -> ProviderDescriptor

Returns identifying metadata for the provider instance.

Source

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.

Source

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§

Source

fn capabilities(&self) -> ProviderCapabilities

Returns feature flags supported by this provider instance.

Source

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.

Source

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.

Source

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".

Implementors§