pub struct LLMRegistry { /* private fields */ }
Expand description
Registry for managing multiple LLM providers
Implementations§
Source§impl LLMRegistry
impl LLMRegistry
Sourcepub fn with_config(config: RegistryConfig) -> Self
pub fn with_config(config: RegistryConfig) -> Self
Create registry with config
Sourcepub async fn register_provider(
&mut self,
name: impl Into<String>,
provider: Arc<dyn LLMProvider>,
) -> LLMResult<()>
pub async fn register_provider( &mut self, name: impl Into<String>, provider: Arc<dyn LLMProvider>, ) -> LLMResult<()>
Register a provider
Sourcepub fn get_provider(&self, name: &str) -> Option<&Arc<dyn LLMProvider>>
pub fn get_provider(&self, name: &str) -> Option<&Arc<dyn LLMProvider>>
Get provider by name
Sourcepub fn list_providers(&self) -> Vec<String>
pub fn list_providers(&self) -> Vec<String>
List all provider names
Sourcepub async fn get_provider_info(&self, name: &str) -> LLMResult<ProviderInfo>
pub async fn get_provider_info(&self, name: &str) -> LLMResult<ProviderInfo>
Get provider info
Sourcepub fn set_default_provider(&mut self, name: impl Into<String>) -> LLMResult<()>
pub fn set_default_provider(&mut self, name: impl Into<String>) -> LLMResult<()>
Set default provider
Sourcepub fn get_default_provider(&self) -> Option<&Arc<dyn LLMProvider>>
pub fn get_default_provider(&self) -> Option<&Arc<dyn LLMProvider>>
Get default provider
Sourcepub async fn configure_sessions(
&mut self,
config: SessionConfig,
) -> LLMResult<()>
pub async fn configure_sessions( &mut self, config: SessionConfig, ) -> LLMResult<()>
Configure session management
Sourcepub fn session_config(&self) -> Option<&SessionConfig>
pub fn session_config(&self) -> Option<&SessionConfig>
Get session configuration
Trait Implementations§
Source§impl Debug for LLMRegistry
impl Debug for LLMRegistry
Source§impl Default for LLMRegistry
impl Default for LLMRegistry
Source§impl SamplingHandler for LLMRegistry
Implement SamplingHandler for LLMRegistry
impl SamplingHandler for LLMRegistry
Implement SamplingHandler for LLMRegistry
Source§fn handle_create_message<'life0, 'async_trait>(
&'life0 self,
request: CreateMessageRequest,
) -> Pin<Box<dyn Future<Output = Result<CreateMessageResult, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_create_message<'life0, 'async_trait>(
&'life0 self,
request: CreateMessageRequest,
) -> Pin<Box<dyn Future<Output = Result<CreateMessageResult, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a sampling/createMessage request from a server Read more
Auto Trait Implementations§
impl Freeze for LLMRegistry
impl !RefUnwindSafe for LLMRegistry
impl Send for LLMRegistry
impl Sync for LLMRegistry
impl Unpin for LLMRegistry
impl !UnwindSafe for LLMRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more