pub struct DeepSeekEmbeddingsConfig {
pub api_key: String,
pub base_url: String,
pub model: String,
}Expand description
Configuration for DeepSeek embeddings API.
Fields§
§api_key: StringDeepSeek API key.
base_url: StringBase URL for the DeepSeek embeddings API.
model: StringEmbedding model name.
Implementations§
Source§impl DeepSeekEmbeddingsConfig
impl DeepSeekEmbeddingsConfig
Sourcepub fn new(api_key: impl Into<String>) -> Self
pub fn new(api_key: impl Into<String>) -> Self
Creates a new DeepSeekEmbeddingsConfig with the given API key.
Sourcepub fn from_env_result() -> Result<Self, EmbeddingError>
pub fn from_env_result() -> Result<Self, EmbeddingError>
Creates a DeepSeekEmbeddingsConfig from environment variables, returning a Result.
Environment variables:
DEEPSEEK_API_KEY: API key (required)DEEPSEEK_BASE_URL: API endpoint (optional)DEEPSEEK_EMBED_MODEL: Model name (optional)
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Sets the embedding model.
Trait Implementations§
Source§impl Clone for DeepSeekEmbeddingsConfig
impl Clone for DeepSeekEmbeddingsConfig
Source§fn clone(&self) -> DeepSeekEmbeddingsConfig
fn clone(&self) -> DeepSeekEmbeddingsConfig
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 CompatSpec for DeepSeekEmbeddingsConfig
impl CompatSpec for DeepSeekEmbeddingsConfig
Source§fn api_key_env() -> &'static str
fn api_key_env() -> &'static str
Environment variable name: API key (used in construction-time error messages, P1-3).
Source§fn batch_size() -> usize
fn batch_size() -> usize
The batch limit for a single request.
Source§fn dimension_for(model: &str) -> Result<usize, EmbeddingError>
fn dimension_for(model: &str) -> Result<usize, EmbeddingError>
Vector dimension for a given model; unknown models must error (P1-2), never lying with a default.
Source§fn from_env_result() -> Result<Self, EmbeddingError>
fn from_env_result() -> Result<Self, EmbeddingError>
Constructs config from environment variables (reuses each config’s from_env_result).
Source§impl Debug for DeepSeekEmbeddingsConfig
impl Debug for DeepSeekEmbeddingsConfig
Auto Trait Implementations§
impl Freeze for DeepSeekEmbeddingsConfig
impl RefUnwindSafe for DeepSeekEmbeddingsConfig
impl Send for DeepSeekEmbeddingsConfig
impl Sync for DeepSeekEmbeddingsConfig
impl Unpin for DeepSeekEmbeddingsConfig
impl UnsafeUnpin for DeepSeekEmbeddingsConfig
impl UnwindSafe for DeepSeekEmbeddingsConfig
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