pub struct ContextOrchestrator { /* private fields */ }Expand description
Main orchestrator for the context engine
Implementations§
Source§impl ContextOrchestrator
impl ContextOrchestrator
Sourcepub async fn new(
database: Arc<MemoryDatabase>,
config: OrchestratorConfig,
) -> Result<Self>
pub async fn new( database: Arc<MemoryDatabase>, config: OrchestratorConfig, ) -> Result<Self>
Create a new context orchestrator
Sourcepub fn set_llm_worker(&mut self, worker: Arc<LLMWorker>)
pub fn set_llm_worker(&mut self, worker: Arc<LLMWorker>)
Set the LLM worker for embedding-based semantic search
Sourcepub fn database(&self) -> &Arc<MemoryDatabase>
pub fn database(&self) -> &Arc<MemoryDatabase>
Chat persistence: Expose database for conversation API handlers
Sourcepub async fn process_conversation(
&self,
session_id: &str,
messages: &[Message],
user_query: Option<&str>,
) -> Result<Vec<Message>>
pub async fn process_conversation( &self, session_id: &str, messages: &[Message], user_query: Option<&str>, ) -> Result<Vec<Message>>
Process conversation and return optimized context
Sourcepub async fn save_assistant_response(
&self,
session_id: &str,
response: &str,
) -> Result<()>
pub async fn save_assistant_response( &self, session_id: &str, response: &str, ) -> Result<()>
Save assistant response to database (Tier 3)
pub async fn get_session_stats(&self, session_id: &str) -> Result<SessionStats>
pub async fn cleanup(&self, older_than_seconds: u64) -> Result<CleanupStats>
Sourcepub async fn search_messages(
&self,
session_id: Option<&str>,
keywords: &[String],
limit: usize,
) -> Result<Vec<StoredMessage>>
pub async fn search_messages( &self, session_id: Option<&str>, keywords: &[String], limit: usize, ) -> Result<Vec<StoredMessage>>
Search messages across sessions by keywords
pub fn set_enabled(&mut self, enabled: bool)
pub fn update_config(&mut self, config: OrchestratorConfig)
pub fn get_config(&self) -> &OrchestratorConfig
pub fn tier_manager(&self) -> &Arc<RwLock<TierManager>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContextOrchestrator
impl !RefUnwindSafe for ContextOrchestrator
impl Send for ContextOrchestrator
impl Sync for ContextOrchestrator
impl Unpin for ContextOrchestrator
impl UnsafeUnpin for ContextOrchestrator
impl !UnwindSafe for ContextOrchestrator
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,
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