pub struct ContextBuilder { /* private fields */ }Expand description
Context builder for creating rich contexts
Public API for external callers to construct RichContext objects. Used internally by ContextManager and available for custom context creation.
Implementations§
Source§impl ContextBuilder
impl ContextBuilder
Sourcepub fn with_conversation(self, conv: ConversationContext) -> Self
pub fn with_conversation(self, conv: ConversationContext) -> Self
Set conversation context
Sourcepub fn with_user(self, user: UserContext) -> Self
pub fn with_user(self, user: UserContext) -> Self
Set user context
Sourcepub fn with_project(self, project: ProjectContext) -> Self
pub fn with_project(self, project: ProjectContext) -> Self
Set project context
Sourcepub fn with_code(self, code: CodeContext) -> Self
pub fn with_code(self, code: CodeContext) -> Self
Set code context
Sourcepub fn with_semantic(self, semantic: SemanticContext) -> Self
pub fn with_semantic(self, semantic: SemanticContext) -> Self
Set semantic context
Sourcepub fn with_document(self, doc: DocumentContext) -> Self
pub fn with_document(self, doc: DocumentContext) -> Self
Set document context
Sourcepub fn with_parent(self, parent: RichContext) -> Self
pub fn with_parent(self, parent: RichContext) -> Self
Set parent context
Sourcepub fn with_decay_rate(self, rate: f32) -> Self
pub fn with_decay_rate(self, rate: f32) -> Self
Set decay rate
Sourcepub fn with_temporal(self, temporal: TemporalContext) -> Self
pub fn with_temporal(self, temporal: TemporalContext) -> Self
Set temporal context
Sourcepub fn with_emotional(self, emotional: EmotionalContext) -> Self
pub fn with_emotional(self, emotional: EmotionalContext) -> Self
Set emotional context (valence, arousal, dominant emotion)
Sourcepub fn with_source(self, source: SourceContext) -> Self
pub fn with_source(self, source: SourceContext) -> Self
Set source context (source type, credibility)
Sourcepub fn with_episode(self, episode: EpisodeContext) -> Self
pub fn with_episode(self, episode: EpisodeContext) -> Self
Set episode context (episode ID, sequence, temporal chain)
Sourcepub fn build(self) -> RichContext
pub fn build(self) -> RichContext
Build the context
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContextBuilder
impl RefUnwindSafe for ContextBuilder
impl Send for ContextBuilder
impl Sync for ContextBuilder
impl Unpin for ContextBuilder
impl UnsafeUnpin for ContextBuilder
impl UnwindSafe for ContextBuilder
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> 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>
Converts
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>
Converts
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)
Converts
&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)
Converts
&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> 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