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§
Sourcefn 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<'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
Sourcefn 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 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