Skip to main content

normalize_semantic/
config.rs

1//! Configuration for the semantic embeddings subsystem.
2//!
3//! Added to `NormalizeConfig` under the `[embeddings]` key:
4//!
5//! ```toml
6//! [embeddings]
7//! enabled = true
8//! model = "nomic-embed-text-v1.5"
9//! ```
10
11use crate::embedder::DEFAULT_MODEL;
12use serde::{Deserialize, Serialize};
13
14#[cfg(feature = "cli")]
15use schemars::JsonSchema;
16
17/// Embeddings configuration (`[embeddings]` section of `.normalize/config.toml`).
18#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
19#[cfg_attr(feature = "cli", derive(JsonSchema))]
20#[serde(default)]
21pub struct EmbeddingsConfig {
22    /// Whether semantic embeddings are enabled. Defaults to false.
23    pub enabled: bool,
24    /// Embedding model to use. Changing this triggers a full re-embed.
25    pub model: String,
26}
27
28impl Default for EmbeddingsConfig {
29    fn default() -> Self {
30        Self {
31            enabled: false,
32            model: DEFAULT_MODEL.to_string(),
33        }
34    }
35}