pub enum ProviderConfig {
Local(LocalConfig),
OpenAI(OpenAIConfig),
Mistral(MistralConfig),
AzureOpenAI(AzureOpenAIConfig),
Custom(CustomConfig),
}Expand description
Provider-specific configuration
This enum wraps all provider-specific configurations, allowing type-safe access to provider-specific features while maintaining a unified interface.
Variants§
Local(LocalConfig)
Local embedding configuration
OpenAI(OpenAIConfig)
OpenAI embedding configuration
Mistral(MistralConfig)
Mistral AI embedding configuration
AzureOpenAI(AzureOpenAIConfig)
Azure OpenAI configuration
Custom(CustomConfig)
Custom provider configuration
Implementations§
Source§impl ProviderConfig
impl ProviderConfig
Sourcepub fn effective_dimension(&self) -> usize
pub fn effective_dimension(&self) -> usize
Get the effective embedding dimension for this provider
Sourcepub fn optimization(&self) -> &OptimizationConfig
pub fn optimization(&self) -> &OptimizationConfig
Get the optimization configuration
Sourcepub fn model_name(&self) -> String
pub fn model_name(&self) -> String
Get the model name
Sourcepub fn openai_default() -> Self
pub fn openai_default() -> Self
Create a default OpenAI configuration
Sourcepub fn mistral_default() -> Self
pub fn mistral_default() -> Self
Create a default Mistral configuration
Sourcepub fn local_default() -> Self
pub fn local_default() -> Self
Create a default local configuration
Source§impl ProviderConfig
impl ProviderConfig
Sourcepub fn openai_3_small() -> Self
pub fn openai_3_small() -> Self
OpenAI text-embedding-3-small
Sourcepub fn openai_3_large() -> Self
pub fn openai_3_large() -> Self
OpenAI text-embedding-3-large
Sourcepub fn openai_ada_002() -> Self
pub fn openai_ada_002() -> Self
OpenAI text-embedding-ada-002
Sourcepub fn mistral_embed() -> Self
pub fn mistral_embed() -> Self
Mistral mistral-embed
Sourcepub fn codestral_embed() -> Self
pub fn codestral_embed() -> Self
Mistral codestral-embed
Sourcepub fn codestral_binary() -> Self
pub fn codestral_binary() -> Self
Mistral codestral-embed with binary output
Sourcepub fn local_sentence_transformer(
model_name: impl Into<String>,
dimension: usize,
) -> Self
pub fn local_sentence_transformer( model_name: impl Into<String>, dimension: usize, ) -> Self
Local sentence transformer
Trait Implementations§
Source§impl Clone for ProviderConfig
impl Clone for ProviderConfig
Source§fn clone(&self) -> ProviderConfig
fn clone(&self) -> ProviderConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProviderConfig
impl Debug for ProviderConfig
Source§impl Default for ProviderConfig
impl Default for ProviderConfig
Source§impl<'de> Deserialize<'de> for ProviderConfig
impl<'de> Deserialize<'de> for ProviderConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProviderConfig
impl RefUnwindSafe for ProviderConfig
impl Send for ProviderConfig
impl Sync for ProviderConfig
impl Unpin for ProviderConfig
impl UnsafeUnpin for ProviderConfig
impl UnwindSafe for ProviderConfig
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 moreSource§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.