pub struct EmbeddingSpec {
pub spec: Option<String>,
pub huggingface: Option<String>,
pub local: Option<String>,
pub ollama: Option<String>,
pub url: Option<String>,
pub model: Option<String>,
pub revision: Option<String>,
pub api_key_env: Option<String>,
pub query_prefix: Option<String>,
pub doc_prefix: Option<String>,
pub pooling: Option<String>,
pub download: Option<bool>,
}Expand description
Normalized, cross-SDK embedding config as forwarded by the native bindings.
Exactly one primary source must be set: either spec (the raw string
shortcut) or one of huggingface / local / ollama / url. The rest are
modifiers.
Fields§
§spec: Option<String>Raw string shortcut — a local model directory path only. A repo-id or
URL string is rejected in favor of the explicit huggingface/url keys.
huggingface: Option<String>Primary source: a HuggingFace repo id.
local: Option<String>Primary source: a local model directory path.
ollama: Option<String>Primary source: an Ollama model name (served via the local Ollama endpoint).
url: Option<String>Primary source: a full OpenAI-compatible endpoint URL.
model: Option<String>Model name for an endpoint source.
revision: Option<String>Git revision for a HuggingFace source.
api_key_env: Option<String>Env var holding the endpoint bearer key.
query_prefix: Option<String>Query-side prefix for asymmetric models.
doc_prefix: Option<String>Document-side prefix for asymmetric models (e.g. e5’s "passage: ").
pooling: Option<String>"cls" | "mean" — overrides auto-detection for an in-process model.
download: Option<bool>Opt in to letting Ratel download a HuggingFace model that is not yet
cached (default false; the built-in default always downloads).
Trait Implementations§
Source§impl Clone for EmbeddingSpec
impl Clone for EmbeddingSpec
Source§fn clone(&self) -> EmbeddingSpec
fn clone(&self) -> EmbeddingSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EmbeddingSpec
impl Debug for EmbeddingSpec
Source§impl Default for EmbeddingSpec
impl Default for EmbeddingSpec
Source§fn default() -> EmbeddingSpec
fn default() -> EmbeddingSpec
Auto Trait Implementations§
impl Freeze for EmbeddingSpec
impl RefUnwindSafe for EmbeddingSpec
impl Send for EmbeddingSpec
impl Sync for EmbeddingSpec
impl Unpin for EmbeddingSpec
impl UnsafeUnpin for EmbeddingSpec
impl UnwindSafe for EmbeddingSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more