pub struct EmbeddingConfig {
pub provider: String,
pub api_key: String,
pub model: Option<String>,
pub dimensions: Option<usize>,
pub base_url: Option<String>,
pub cache_size: Option<usize>,
}Expand description
Serializable configuration for constructing an embedding provider.
Fields§
§provider: StringProvider name ("openai", "cohere", "voyage", "local").
api_key: StringAPI key (ignored for "local").
model: Option<String>Model name override.
dimensions: Option<usize>Override for output dimensions.
base_url: Option<String>Custom API base URL (e.g. Azure OpenAI).
cache_size: Option<usize>If set, wraps the provider with a CachedEmbeddingProvider.
Implementations§
Source§impl EmbeddingConfig
impl EmbeddingConfig
Sourcepub fn build(&self) -> ArgentorResult<Arc<dyn EmbeddingProvider>>
pub fn build(&self) -> ArgentorResult<Arc<dyn EmbeddingProvider>>
Build an EmbeddingProvider from this configuration.
Returns an Arc-wrapped provider, optionally wrapped in a cache layer.
Trait Implementations§
Source§impl Clone for EmbeddingConfig
impl Clone for EmbeddingConfig
Source§fn clone(&self) -> EmbeddingConfig
fn clone(&self) -> EmbeddingConfig
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 moreSource§impl Debug for EmbeddingConfig
impl Debug for EmbeddingConfig
Source§impl Default for EmbeddingConfig
impl Default for EmbeddingConfig
Source§impl<'de> Deserialize<'de> for EmbeddingConfig
impl<'de> Deserialize<'de> for EmbeddingConfig
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 EmbeddingConfig
impl RefUnwindSafe for EmbeddingConfig
impl Send for EmbeddingConfig
impl Sync for EmbeddingConfig
impl Unpin for EmbeddingConfig
impl UnsafeUnpin for EmbeddingConfig
impl UnwindSafe for EmbeddingConfig
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