pub struct CompactContextTool;Expand description
Server-side tool for manually triggering conversation context compression.
Unlike automatic compression (which triggers based on token thresholds), this tool lets the model or user proactively compress history at natural task boundaries. It bypasses the exposure gate and always forces a compression cycle.
Trait Implementations§
Source§impl Tool for CompactContextTool
impl Tool for CompactContextTool
fn name(&self) -> &str
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable tool description for LLM.
Source§fn parameters_schema(&self) -> Value
fn parameters_schema(&self) -> Value
JSON Schema for tool parameters.
Source§fn classify(&self, _args: &Value) -> ToolClass
fn classify(&self, _args: &Value) -> ToolClass
Per-call scheduling + permission-gating class (args-aware). Folds the
former
mutability/call_mutability/concurrency_safe/
call_concurrency_safe hooks into one value. Defaults to the conservative
ToolClass::MUTATING_SERIAL (mutating, serial, not promotable).Source§fn invoke<'life0, 'async_trait>(
&'life0 self,
args: Value,
_ctx: ToolCtx,
) -> Pin<Box<dyn Future<Output = Result<ToolOutcome, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
CompactContextTool: 'async_trait,
fn invoke<'life0, 'async_trait>(
&'life0 self,
args: Value,
_ctx: ToolCtx,
) -> Pin<Box<dyn Future<Output = Result<ToolOutcome, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
CompactContextTool: 'async_trait,
The sole execution entry: returns the call’s per-call
ToolOutcome
(Completed / Running
/ NeedsHuman), or a ToolError for
infrastructure / argument failures (preserved from the former execute). Read moreSource§fn to_schema(&self) -> ToolSchema
fn to_schema(&self) -> ToolSchema
Convert tool to LLM-compatible schema. Read more
Auto Trait Implementations§
impl Freeze for CompactContextTool
impl RefUnwindSafe for CompactContextTool
impl Send for CompactContextTool
impl Sync for CompactContextTool
impl Unpin for CompactContextTool
impl UnsafeUnpin for CompactContextTool
impl UnwindSafe for CompactContextTool
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