Skip to main content

ProviderStore

Trait ProviderStore 

Source
pub trait ProviderStore: Send + Sync {
    // Required methods
    fn get_provider<'life0, 'async_trait>(
        &'life0 self,
        id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Provider>, PersistenceError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn get_provider_by_name<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tenant_id: Uuid,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Provider>, PersistenceError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn list_providers<'life0, 'async_trait>(
        &'life0 self,
        tenant_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Provider>, PersistenceError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn get_enabled_providers<'life0, 'async_trait>(
        &'life0 self,
        tenant_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Provider>, PersistenceError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Provider 存储 trait

提供 LLM Provider 的数据库操作

Required Methods§

Source

fn get_provider<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Provider>, PersistenceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

根据 ID 获取 provider

Source

fn get_provider_by_name<'life0, 'life1, 'async_trait>( &'life0 self, tenant_id: Uuid, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Provider>, PersistenceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

根据名称和租户 ID 获取 provider

Source

fn list_providers<'life0, 'async_trait>( &'life0 self, tenant_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Provider>, PersistenceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

列出租户的所有 providers

Source

fn get_enabled_providers<'life0, 'async_trait>( &'life0 self, tenant_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Provider>, PersistenceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

获取租户所有启用的 providers

Implementors§