pub struct UnifiedLLMProvider { /* private fields */ }Implementations§
Source§impl UnifiedLLMProvider
impl UnifiedLLMProvider
pub fn new( provider_type: ProviderType, model: String, api_key: Option<String>, base_url: Option<String>, ) -> Result<UnifiedLLMProvider, LLMError>
Sourcepub fn from_spec_config(
provider_type: ProviderType,
model: &str,
api_key: Option<String>,
base_url: Option<String>,
default_config: LLMConfig,
) -> Result<UnifiedLLMProvider, LLMError>
pub fn from_spec_config( provider_type: ProviderType, model: &str, api_key: Option<String>, base_url: Option<String>, default_config: LLMConfig, ) -> Result<UnifiedLLMProvider, LLMError>
Create a new UnifiedLLMProvider with explicit config defaults.
pub fn from_env( provider_type: ProviderType, model: impl Into<String>, ) -> Result<UnifiedLLMProvider, LLMError>
pub fn provider_type(&self) -> ProviderType
pub fn model_name(&self) -> &str
pub fn base_url(&self) -> Option<&str>
Trait Implementations§
Source§impl Debug for UnifiedLLMProvider
impl Debug for UnifiedLLMProvider
Source§impl LLMProvider for UnifiedLLMProvider
impl LLMProvider for UnifiedLLMProvider
Source§fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
config: Option<&'life2 LLMConfig>,
) -> Pin<Box<dyn Future<Output = Result<LLMResponse, LLMError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
UnifiedLLMProvider: 'async_trait,
fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
config: Option<&'life2 LLMConfig>,
) -> Pin<Box<dyn Future<Output = Result<LLMResponse, LLMError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
UnifiedLLMProvider: 'async_trait,
Send messages and get a complete response.
Source§fn complete_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
config: Option<&'life2 LLMConfig>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<LLMChunk, LLMError>> + Unpin + Send>, LLMError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
UnifiedLLMProvider: 'async_trait,
fn complete_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
config: Option<&'life2 LLMConfig>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<LLMChunk, LLMError>> + Unpin + Send>, LLMError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
UnifiedLLMProvider: 'async_trait,
Send messages and get a streaming response.
Source§fn provider_name(&self) -> &str
fn provider_name(&self) -> &str
Provider identifier (e.g.
"openai", "anthropic").Source§fn supports(&self, feature: LLMFeature) -> bool
fn supports(&self, feature: LLMFeature) -> bool
Check if this provider supports a given feature.
Auto Trait Implementations§
impl Freeze for UnifiedLLMProvider
impl !RefUnwindSafe for UnifiedLLMProvider
impl Send for UnifiedLLMProvider
impl Sync for UnifiedLLMProvider
impl Unpin for UnifiedLLMProvider
impl UnsafeUnpin for UnifiedLLMProvider
impl !UnwindSafe for UnifiedLLMProvider
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> 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 moreCreates a shared type from an unshared type.