Skip to main content

ResolvedEmbeddings

Struct ResolvedEmbeddings 

Source
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: String

Embedding 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: String

Embedding 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: String

Embedding 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: u32

Backfill 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: ConfigSource

Provenance of the resolved configuration.

Implementations§

Source§

impl ResolvedEmbeddings

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> ResolvedEmbeddings

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResolvedEmbeddings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ResolvedEmbeddings

Source§

impl PartialEq for ResolvedEmbeddings

Source§

fn eq(&self, other: &ResolvedEmbeddings) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ResolvedEmbeddings

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more