pub struct MemoryConfigBuilder { /* private fields */ }Expand description
Fluent builder for MemoryConfig.
MemoryConfig is #[non_exhaustive] to keep adding fields
SemVer-additive. Prefer this builder over struct-literal construction
so future fields land transparently.
use rig_memvid::{MemoryConfig, WritePolicy};
let config = MemoryConfig::builder()
.policy(WritePolicy::Raw)
.commit_each_turn(false)
.principal(Some("Alice".into()))
.persist_assistant(false)
.build();Implementations§
Source§impl MemoryConfigBuilder
impl MemoryConfigBuilder
Sourcepub fn policy(self, policy: WritePolicy) -> Self
pub fn policy(self, policy: WritePolicy) -> Self
Set the WritePolicy.
Sourcepub fn commit_each_turn(self, commit_each_turn: bool) -> Self
pub fn commit_each_turn(self, commit_each_turn: bool) -> Self
Whether to commit() after every turn.
Tags applied to every persisted frame.
Sourcepub fn scope(self, scope: Option<String>) -> Self
pub fn scope(self, scope: Option<String>) -> Self
Logical scope (URI prefix) for every persisted frame.
Sourcepub fn principal(self, principal: Option<String>) -> Self
pub fn principal(self, principal: Option<String>) -> Self
Stable identity for the human side of the conversation.
Sourcepub fn persist_assistant(self, persist_assistant: bool) -> Self
pub fn persist_assistant(self, persist_assistant: bool) -> Self
Whether to persist assistant turns.
Sourcepub fn supplemental_profile_cards(self, on: bool) -> Self
pub fn supplemental_profile_cards(self, on: bool) -> Self
Whether to add deterministic supplemental profile / relationship cards.
Sourcepub fn extract_dates(self, on: bool) -> Self
pub fn extract_dates(self, on: bool) -> Self
Run memvid’s date extractor over each persisted frame.
Sourcepub fn extract_triplets(self, on: bool) -> Self
pub fn extract_triplets(self, on: bool) -> Self
Run memvid’s triplet extractor over each persisted frame.
Sourcepub fn observe_conversation_id(self, id: Option<String>) -> Self
pub fn observe_conversation_id(self, id: Option<String>) -> Self
Telemetry conversation ID for the observe feature.
Sourcepub fn on_write_failure(self, policy: WriteFailure) -> Self
pub fn on_write_failure(self, policy: WriteFailure) -> Self
Policy for frame-write failures.
Sourcepub fn rewrite_principal_pronouns(self, on: bool) -> Self
pub fn rewrite_principal_pronouns(self, on: bool) -> Self
Enable or disable the English-only principal-pronoun rewrite.
Sourcepub fn build(self) -> MemoryConfig
pub fn build(self) -> MemoryConfig
Finalise the builder and return a MemoryConfig.
Trait Implementations§
Source§impl Clone for MemoryConfigBuilder
impl Clone for MemoryConfigBuilder
Source§fn clone(&self) -> MemoryConfigBuilder
fn clone(&self) -> MemoryConfigBuilder
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 MemoryConfigBuilder
impl Debug for MemoryConfigBuilder
Source§impl Default for MemoryConfigBuilder
impl Default for MemoryConfigBuilder
Source§fn default() -> MemoryConfigBuilder
fn default() -> MemoryConfigBuilder
Auto Trait Implementations§
impl Freeze for MemoryConfigBuilder
impl !RefUnwindSafe for MemoryConfigBuilder
impl Send for MemoryConfigBuilder
impl Sync for MemoryConfigBuilder
impl Unpin for MemoryConfigBuilder
impl UnsafeUnpin for MemoryConfigBuilder
impl !UnwindSafe for MemoryConfigBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
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> 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