pub struct Config {
pub embedder: Option<String>,
pub reranker: Option<String>,
pub keyword_sufficiency_threshold: Option<usize>,
pub rerank_top: Option<usize>,
pub rrf_k: Option<i32>,
pub semantic_min_score: Option<f32>,
pub auto_update: Option<bool>,
pub max_chunk_tokens: usize,
pub chunk_overlap: usize,
pub roots: Vec<PathBuf>,
pub local_engine: LocalEngineConfig,
pub openrouter: OpenRouterConfig,
}Fields§
§embedder: Option<String>Pins a model: remote defaults never move it. Unset means follow defaults.
reranker: Option<String>§keyword_sufficiency_threshold: Option<usize>Search values are Options so only what the user wrote overrides remote
config; the built-ins live in SearchConfig::default().
rerank_top: Option<usize>§rrf_k: Option<i32>§semantic_min_score: Option<f32>§auto_update: Option<bool>false stops the daemon installing approved updates.
max_chunk_tokens: usize§chunk_overlap: usize§roots: Vec<PathBuf>§local_engine: LocalEngineConfigOptional local, OpenAI-compatible server (Ollama, LM Studio, vLLM).
Only used by paper answer --polish --engine local.
openrouter: OpenRouterConfigOptional cloud fallback. Only used by paper answer --polish --engine openrouter, and only when an API key is configured.
Implementations§
Source§impl Config
impl Config
pub fn load() -> Result<Self>
pub fn load_from(path: &Path) -> Result<Self>
pub fn save(&self) -> Result<()>
Sourcepub fn save_to(&self, path: &Path) -> Result<()>
pub fn save_to(&self, path: &Path) -> Result<()>
Owner-only on Unix: the file may hold the OpenRouter API key. Written to
a private temp file in the same directory and renamed over path, so a
reader (or a crash) never sees a half-written config, and the new file
is 0600 before any content lands in it (tempfile creates it create_new
with an unpredictable name; mode 0600 on Unix). A symlinked config is
written through, as before.
Sourcepub fn search(&self, remote: Option<&RemoteConfig>) -> SearchConfig
pub fn search(&self, remote: Option<&RemoteConfig>) -> SearchConfig
Local value > remote value > built-in default. The caller passes only an unexpired remote config.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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>,
Auto Trait Implementations§
impl Forget for Config
impl Freeze for Config
impl Move for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
impl<T> CloneAny for T
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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