pub struct EmbeddingsConfig {
pub provider: EmbeddingProvider,
pub api_key: String,
pub base_url: Option<String>,
pub model: String,
pub dimension: Option<usize>,
}Expand description
嵌入模型配置
Fields§
§provider: EmbeddingProvider提供商类型
api_key: StringAPI 密钥(本地模型可为空)
base_url: Option<String>API 基础 URL(可选)
model: String模型名称
dimension: Option<usize>向量维度(可选,用于本地模型)
Implementations§
Source§impl EmbeddingsConfig
impl EmbeddingsConfig
Sourcepub fn openai_from_env() -> Result<Self>
pub fn openai_from_env() -> Result<Self>
从环境变量创建 OpenAI 配置
Sourcepub fn huggingface_from_env() -> Result<Self>
pub fn huggingface_from_env() -> Result<Self>
从环境变量创建 HuggingFace 配置
Sourcepub fn cohere_from_env() -> Result<Self>
pub fn cohere_from_env() -> Result<Self>
从环境变量创建 Cohere 配置
Trait Implementations§
Source§impl Clone for EmbeddingsConfig
impl Clone for EmbeddingsConfig
Source§fn clone(&self) -> EmbeddingsConfig
fn clone(&self) -> EmbeddingsConfig
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 EmbeddingsConfig
impl Debug for EmbeddingsConfig
Auto Trait Implementations§
impl Freeze for EmbeddingsConfig
impl RefUnwindSafe for EmbeddingsConfig
impl Send for EmbeddingsConfig
impl Sync for EmbeddingsConfig
impl Unpin for EmbeddingsConfig
impl UnsafeUnpin for EmbeddingsConfig
impl UnwindSafe for EmbeddingsConfig
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