pub struct ContextManager { /* private fields */ }Expand description
Context manager for automatic context capture
Public API for managing conversation context across sessions. Tracks user profile, project state, and temporal patterns.
Implementations§
Source§impl ContextManager
impl ContextManager
Sourcepub fn capture_context(&mut self) -> Result<RichContext>
pub fn capture_context(&mut self) -> Result<RichContext>
Capture current context automatically
Sourcepub fn update_user_profile(&mut self, experience: &Experience)
pub fn update_user_profile(&mut self, experience: &Experience)
Update user profile based on interactions
Sourcepub fn update_conversation(
&mut self,
conv_id: String,
message: String,
topic: Option<String>,
) -> Result<()>
pub fn update_conversation( &mut self, conv_id: String, message: String, topic: Option<String>, ) -> Result<()>
Update conversation context
Sourcepub fn update_code_context(
&mut self,
file: String,
scope: Option<String>,
) -> Result<()>
pub fn update_code_context( &mut self, file: String, scope: Option<String>, ) -> Result<()>
Update code context
Sourcepub fn update_project_context(
&mut self,
project_id: String,
project: ProjectContext,
) -> Result<()>
pub fn update_project_context( &mut self, project_id: String, project: ProjectContext, ) -> Result<()>
Update project context
Sourcepub fn get_current_context(&self) -> Option<&RichContext>
pub fn get_current_context(&self) -> Option<&RichContext>
Get current context
Sourcepub fn merge_contexts(&self, contexts: Vec<RichContext>) -> RichContext
pub fn merge_contexts(&self, contexts: Vec<RichContext>) -> RichContext
Merge multiple contexts
Sourcepub fn find_similar_contexts(
&self,
query_context: &RichContext,
top_k: usize,
) -> Vec<RichContext>
pub fn find_similar_contexts( &self, query_context: &RichContext, top_k: usize, ) -> Vec<RichContext>
Find similar contexts from history
Sourcepub fn get_user_expertise(&self) -> &Vec<String>
pub fn get_user_expertise(&self) -> &Vec<String>
Get user expertise areas
Sourcepub fn add_user_expertise(&mut self, entity: String)
pub fn add_user_expertise(&mut self, entity: String)
Add entity to user expertise
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContextManager
impl RefUnwindSafe for ContextManager
impl Send for ContextManager
impl Sync for ContextManager
impl Unpin for ContextManager
impl UnsafeUnpin for ContextManager
impl UnwindSafe for ContextManager
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