pub struct QwenEmbeddingsConfig {
pub api_key: String,
pub base_url: String,
pub model: String,
}Expand description
Configuration for Qwen embeddings API.
Fields§
§api_key: StringQwen API key.
base_url: StringBase URL for the Qwen (DashScope) embeddings API.
model: StringEmbedding model name.
Implementations§
Source§impl QwenEmbeddingsConfig
impl QwenEmbeddingsConfig
Sourcepub fn new(api_key: impl Into<String>) -> Self
pub fn new(api_key: impl Into<String>) -> Self
Creates a new QwenEmbeddingsConfig with the given API key.
Sourcepub fn from_env_result() -> Result<Self, EmbeddingError>
pub fn from_env_result() -> Result<Self, EmbeddingError>
Creates a QwenEmbeddingsConfig from environment variables, returning a Result.
Environment variables:
QWEN_API_KEY: API key (required)QWEN_BASE_URL: API endpoint (optional)QWEN_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 QwenEmbeddingsConfig
impl Clone for QwenEmbeddingsConfig
Source§fn clone(&self) -> QwenEmbeddingsConfig
fn clone(&self) -> QwenEmbeddingsConfig
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 QwenEmbeddingsConfig
impl CompatSpec for QwenEmbeddingsConfig
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 QwenEmbeddingsConfig
impl Debug for QwenEmbeddingsConfig
Auto Trait Implementations§
impl Freeze for QwenEmbeddingsConfig
impl RefUnwindSafe for QwenEmbeddingsConfig
impl Send for QwenEmbeddingsConfig
impl Sync for QwenEmbeddingsConfig
impl Unpin for QwenEmbeddingsConfig
impl UnsafeUnpin for QwenEmbeddingsConfig
impl UnwindSafe for QwenEmbeddingsConfig
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