pub struct GenericProvider { /* private fields */ }Expand description
A provider whose behavior is fully described by a ProviderConfig.
Implementations§
Source§impl GenericProvider
impl GenericProvider
pub fn from_env(config: &'static ProviderConfig) -> Result<Self>
pub fn from_env_with_connection( config: &'static ProviderConfig, connection: ProviderConnectionConfig, ) -> Result<Self>
pub fn new(api_key: String, config: &'static ProviderConfig) -> Result<Self>
pub fn new_with_connection( api_key: String, config: &'static ProviderConfig, connection: ProviderConnectionConfig, ) -> Result<Self>
pub fn with_model(self, model: &str) -> Self
Trait Implementations§
Source§impl StreamingModelProvider for GenericProvider
impl StreamingModelProvider for GenericProvider
fn stream_response(&self, context: &Context) -> LlmResponseStream
fn display_name(&self) -> String
Source§fn context_window(&self) -> Option<u32>
fn context_window(&self) -> Option<u32>
Context window size in tokens for the current model.
Returns
None for unknown models (e.g. Ollama, LlamaCpp).Auto Trait Implementations§
impl !RefUnwindSafe for GenericProvider
impl !UnwindSafe for GenericProvider
impl Freeze for GenericProvider
impl Send for GenericProvider
impl Sync for GenericProvider
impl Unpin for GenericProvider
impl UnsafeUnpin for GenericProvider
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.