pub struct EmbeddingConfig {
pub provider: EmbeddingProviderType,
pub azure_ml: Option<AzureMLSettings>,
pub openai: Option<OpenAISettings>,
}Expand description
Embedding provider configuration.
Controls which provider generates embeddings for semantic search.
§Example TOML
[embedding]
provider = "local" # or "azure-ml" or "openai"
[embedding.azure_ml]
semantic_endpoint = "https://..."
code_endpoint = "https://..."
auth_key_env = "AZURE_ML_KEY"
[embedding.openai]
url = "https://api.openai.com/v1"
api_key_env = "OPENAI_API_KEY"
semantic_model = "text-embedding-3-small"Fields§
§provider: EmbeddingProviderTypeWhich embedding provider to use
azure_ml: Option<AzureMLSettings>Azure ML provider settings (required when provider = “azure-ml”)
openai: Option<OpenAISettings>OpenAI-compatible provider settings (required when provider = “openai”)
Implementations§
Source§impl EmbeddingConfig
impl EmbeddingConfig
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Validate that required settings exist for the selected provider.
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 · 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§fn default() -> EmbeddingConfig
fn default() -> EmbeddingConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EmbeddingConfigwhere
EmbeddingConfig: Default,
impl<'de> Deserialize<'de> for EmbeddingConfigwhere
EmbeddingConfig: Default,
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 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