pub struct ProviderRegistry { /* private fields */ }Expand description
Lookup from provider id ("anthropic", "openai", …) to the Provider that serves it.
Implementations§
Source§impl ProviderRegistry
impl ProviderRegistry
Sourcepub fn new(
anthropic_base: impl Into<String>,
openai_base: impl Into<String>,
) -> Self
pub fn new( anthropic_base: impl Into<String>, openai_base: impl Into<String>, ) -> Self
Build the standard registry: the built-in anthropic + openai providers.
Sourcepub fn from_config(
defs: &[ProviderDef],
anthropic_base: impl Into<String>,
openai_base: impl Into<String>,
) -> Self
pub fn from_config( defs: &[ProviderDef], anthropic_base: impl Into<String>, openai_base: impl Into<String>, ) -> Self
Build the registry with the built-in anthropic / openai providers plus every configured
[[provider]] entry — so a ladder can route to any OpenAI-compatible or Anthropic-compatible
endpoint (Groq, Together, Fireworks, DeepSeek, Mistral, xAI, OpenRouter, Ollama, vLLM, Azure,
…) by id. A [[provider]] whose id is anthropic or openai overrides the built-in default
(e.g. to point openai at Azure). Shares one HTTP client across all of them.
Trait Implementations§
Source§impl Clone for ProviderRegistry
impl Clone for ProviderRegistry
Source§fn clone(&self) -> ProviderRegistry
fn clone(&self) -> ProviderRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ProviderRegistry
impl !UnwindSafe for ProviderRegistry
impl Freeze for ProviderRegistry
impl Send for ProviderRegistry
impl Sync for ProviderRegistry
impl Unpin for ProviderRegistry
impl UnsafeUnpin for ProviderRegistry
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