pub struct LlmClient { /* private fields */ }
Expand description
Multi-provider LLM client with automatic failover
Implementations§
Source§impl LlmClient
impl LlmClient
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if any LLM provider is available
Sourcepub fn has_openai_key(&self) -> bool
pub fn has_openai_key(&self) -> bool
Check availability of specific providers
pub fn has_anthropic_key(&self) -> bool
pub fn has_groq_key(&self) -> bool
pub fn has_openrouter_key(&self) -> bool
pub fn has_huggingface_key(&self) -> bool
Sourcepub fn get_best_provider(&self) -> Option<LlmProvider>
pub fn get_best_provider(&self) -> Option<LlmProvider>
Get the best available provider based on configuration and API key availability
Sourcepub fn is_provider_available(&self, provider: &LlmProvider) -> bool
pub fn is_provider_available(&self, provider: &LlmProvider) -> bool
Check if a specific provider is available
Sourcepub async fn synthesize_answer(
&self,
query: &str,
results: &[RagSearchResult],
) -> Result<LlmResponse>
pub async fn synthesize_answer( &self, query: &str, results: &[RagSearchResult], ) -> Result<LlmResponse>
Synthesize an answer from search results using the best available provider
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LlmClient
impl !RefUnwindSafe for LlmClient
impl Send for LlmClient
impl Sync for LlmClient
impl Unpin for LlmClient
impl !UnwindSafe for LlmClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more