pub struct ResolvedEmbeddings {
pub backend: String,
pub url: String,
pub model: String,
pub backfill_batch: u32,
pub embedding_dim: Option<u32>,
pub requested_dim: Option<u32>,
pub key_source: KeySource,
pub source: ConfigSource,
/* private fields */
}Expand description
Canonical resolved-embedder configuration. Produced by
AppConfig::resolve_embeddings.
Secret handling (#1598). The api_key field is private;
access via Self::api_key. The manual Debug impl redacts the
value (<redacted>), mirroring ResolvedLlm.
Fields§
§backend: StringEmbedding backend selector. "ollama" (local /api/embed
wire shape) or, since #1598, any #1067 OpenAI-compatible alias
/ the generic openai-compatible escape hatch. Classify via
is_api_embed_backend.
url: StringEmbedding endpoint base URL. The [embeddings].base_url /
[embeddings].url synonym merge happens in the resolver
(base_url wins); the field keeps the historical url name
to limit call-site churn (#1598).
model: StringEmbedding model identifier (canonicalised — legacy aliases
nomic_embed_v15 / mini_lm_l6_v2 are mapped to the
EmbeddingModel enum’s canonical HF id at resolve time).
backfill_batch: u32Backfill batch size. Bounded 1..=10000; out-of-range values
fall back to 100 with a WARN.
embedding_dim: Option<u32>v0.7.x (issue #1169) — vector dim of the resolved model, when
known. #1598: the explicit [embeddings].dim override wins
over the canonical_embedding_dim table lookup. None when
the operator chose a model id that isn’t in the table and set
no override — in that case build_capability_models falls
back to the tier preset’s dim (preserving pre-#1169 behaviour
for unrecognised ids and avoiding the silent-wrong-dim trap
for the recognised ones).
requested_dim: Option<u32>#1598 (fleet follow-up) — the EXPLICIT [embeddings].dim
override only (never table-derived). For OpenAI-compatible
backends this is also sent as the wire dimensions request
param, so Matryoshka-capable API models (gemini-embedding-2,
text-embedding-3-*) return truncated vectors at the operator’s
declared dim — the mechanism that keeps pgvector vector(768)
fleet schemas + ANN indexes (≤2000-dim limit) usable with
high-dim API models. None = model-native dim.
key_source: KeySource#1598 — provenance of the resolved API key for boot-banner / doctor-probe display.
source: ConfigSourceProvenance of the resolved configuration.
Implementations§
Source§impl ResolvedEmbeddings
impl ResolvedEmbeddings
Sourcepub fn api_key(&self) -> Option<&str>
pub fn api_key(&self) -> Option<&str>
Access the resolved embedding API key. Use this only when
constructing the embed client; do NOT log or {:?} the result.
Sourcepub fn from_parts(
backend: String,
url: String,
model: String,
embedding_dim: Option<u32>,
api_key: Option<String>,
) -> Self
pub fn from_parts( backend: String, url: String, model: String, embedding_dim: Option<u32>, api_key: Option<String>, ) -> Self
#1598 — construct from explicit parts. Prefer
AppConfig::resolve_embeddings; this exists for tests and
sibling surfaces (e.g. the reembed CLI) that synthesise a
resolved view without an AppConfig.
Sourcepub fn with_requested_dim(self, dim: Option<u32>) -> Self
pub fn with_requested_dim(self, dim: Option<u32>) -> Self
#1598 (fleet follow-up) — builder for the explicit requested
output dimensionality (see Self::requested_dim).
Trait Implementations§
Source§impl Clone for ResolvedEmbeddings
impl Clone for ResolvedEmbeddings
Source§fn clone(&self) -> ResolvedEmbeddings
fn clone(&self) -> ResolvedEmbeddings
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 ResolvedEmbeddings
impl Debug for ResolvedEmbeddings
impl Eq for ResolvedEmbeddings
Source§impl PartialEq for ResolvedEmbeddings
impl PartialEq for ResolvedEmbeddings
Source§fn eq(&self, other: &ResolvedEmbeddings) -> bool
fn eq(&self, other: &ResolvedEmbeddings) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ResolvedEmbeddings
Auto Trait Implementations§
impl Freeze for ResolvedEmbeddings
impl RefUnwindSafe for ResolvedEmbeddings
impl Send for ResolvedEmbeddings
impl Sync for ResolvedEmbeddings
impl Unpin for ResolvedEmbeddings
impl UnsafeUnpin for ResolvedEmbeddings
impl UnwindSafe for ResolvedEmbeddings
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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