pub struct ContextManager { /* private fields */ }Expand description
Deterministic initial context assembly. Full request budgeting (including Tool schemas and output reservation) is enforced immediately before every model invocation by the compaction pipeline.
Implementations§
Source§impl ContextManager
impl ContextManager
pub fn new(max_messages: usize) -> Result<Self, KernelFailure>
pub fn assemble( &self, system_prompt: &str, context_items: Vec<ContextItem>, history: Vec<ConversationMessage>, request_messages: &[ConversationMessage], ) -> Result<Vec<ModelMessage>, KernelFailure>
pub fn refresh_system( &self, messages: &mut [ModelMessage], system_prompt: &str, context_items: Vec<ContextItem>, ) -> Result<(), KernelFailure>
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