pub struct Config {
pub database: DatabaseConfig,
pub embedding: EmbeddingConfig,
pub llm: LlmConfig,
pub server: ServerConfig,
pub hnsw: HnswConfig,
pub consolidation: ConsolidationConfig,
pub deduplication: DeduplicationConfig,
pub trainer: TrainerConfig,
pub search: SearchConfig,
}Fields§
§database: DatabaseConfig§embedding: EmbeddingConfig§llm: LlmConfig§server: ServerConfig§hnsw: HnswConfig§consolidation: ConsolidationConfig§deduplication: DeduplicationConfig§trainer: TrainerConfig§search: SearchConfigImplementations§
Source§impl Config
impl Config
Sourcepub fn load() -> Result<Self, CoreError>
pub fn load() -> Result<Self, CoreError>
Loads the effective config by layering project-local engram.toml
over the global ~/.engram/engram.toml, then applying ENGRAM_* env
overrides. Final priority is env > project-local > global.
When neither config file exists the built-in defaults are used. The
api_key of each provider is always taken from the global layer — a
project-local config can never set or change a secret.
pub fn load_from_path(path: &str) -> Result<Self, CoreError>
pub fn build_embedding_provider( &self, ) -> Result<Box<dyn EmbeddingProvider + Send + Sync>, CoreError>
pub fn build_text_generator( &self, ) -> Result<Box<dyn TextGenerator + Send + Sync>, CoreError>
pub fn build_hnsw_params(&self) -> Result<HnswParams, CoreError>
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze 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
Mutably borrows from an owned value. Read more
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> 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> ⓘ
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 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> ⓘ
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