pub struct SemanticConfig {
pub embedding_model: String,
pub embedding_model_path: Option<String>,
pub top_k: usize,
pub embeddings_endpoint: Option<String>,
pub embeddings_api: Option<BackendKind>,
pub on_embed_failure: OnEmbedFailure,
}Expand description
[context.semantic] — the embedding RAG-for-code feature’s settings (Step
26.5.4, #582).
Fields§
§embedding_model: StringEmbedding model used to index the repo + embed queries. Default
nomic-embed-text (the HTTP path). The model must exist on the embeddings
endpoint (see embeddings_endpoint); when it can’t be reached the feature
follows on_embed_failure.
For the embedded backend (embeddings_api = "embedded", #720) this is
only a label — the model is loaded from embedding_model_path — and it
should name a candle-clean standard-BERT model (e.g.
bge-small-en-v1.5), NOT nomic-embed-text, which candle 0.8 cannot load.
embedding_model_path: Option<String>Local model directory for the embedded embedder (#720): a
candle-clean standard-BERT model dir holding
config.json + tokenizer.json + model.safetensors (e.g. a fetched
BAAI/bge-small-en-v1.5). None (default) ⇒ the embedded path can’t
load and reports a clear error. When embeddings_api and
embeddings_endpoint are unset, a configured path selects embedded
embeddings automatically. Ignored by explicit HTTP embeddings targets.
Mirrors the summarizer’s model_path.
top_k: usizeHow many code chunks to retrieve per turn. Default 5.
embeddings_endpoint: Option<String>Dedicated endpoint that serves embeddings (e.g. an Ollama
http://host:11434). None (default) leaves semantic retrieval on the
embedded path unless embeddings_api explicitly selects an HTTP protocol.
Set this to a real embeddings host when remote/vector-server embeddings
are a deliberate performance choice.
embeddings_api: Option<BackendKind>Wire protocol of embeddings_endpoint — ollama (/api/embeddings) or
openai (/v1/embeddings). embedded selects the in-process embedder.
None (default) selects embedded embeddings when embeddings_endpoint
is also unset; with an explicit endpoint, None assumes ollama.
on_embed_failure: OnEmbedFailureWhat to do when embedding fails structurally (wrong endpoint / model
absent): disable (default) stops indexing after the first failure with
one actionable message; warn logs per-chunk and keeps trying.
Trait Implementations§
Source§impl Clone for SemanticConfig
impl Clone for SemanticConfig
Source§fn clone(&self) -> SemanticConfig
fn clone(&self) -> SemanticConfig
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 SemanticConfig
impl Debug for SemanticConfig
Source§impl Default for SemanticConfig
impl Default for SemanticConfig
Source§impl<'de> Deserialize<'de> for SemanticConfig
impl<'de> Deserialize<'de> for SemanticConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SemanticConfig
Source§impl PartialEq for SemanticConfig
impl PartialEq for SemanticConfig
Source§fn eq(&self, other: &SemanticConfig) -> bool
fn eq(&self, other: &SemanticConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SemanticConfig
impl Serialize for SemanticConfig
impl StructuralPartialEq for SemanticConfig
Auto Trait Implementations§
impl Freeze for SemanticConfig
impl RefUnwindSafe for SemanticConfig
impl Send for SemanticConfig
impl Sync for SemanticConfig
impl Unpin for SemanticConfig
impl UnsafeUnpin for SemanticConfig
impl UnwindSafe for SemanticConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.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
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