pub enum ContextEdit {
ClearToolUses {
trigger: Option<TokenThreshold>,
keep: Option<TokenThreshold>,
clear_at_least: Option<TokenThreshold>,
exclude_tools: Option<Vec<String>>,
clear_tool_inputs: Option<bool>,
},
ClearThinking {
keep: Option<ThinkingKeep>,
},
}Available on crate feature
anthropic-client only.Expand description
A single context editing strategy.
Variants§
ClearToolUses
Clear old tool use/result pairs when context grows too large.
Fields
§
trigger: Option<TokenThreshold>When to activate (defaults to 100k input tokens).
§
keep: Option<TokenThreshold>How many recent tool use/result pairs to keep (defaults to 3).
§
clear_at_least: Option<TokenThreshold>Minimum tokens to clear each activation.
ClearThinking
Clear thinking blocks from earlier turns.
Fields
§
keep: Option<ThinkingKeep>How many recent thinking turns to keep. Defaults to 1.
Use "all" to keep everything (maximises cache hits).
Trait Implementations§
Source§impl Clone for ContextEdit
impl Clone for ContextEdit
Source§fn clone(&self) -> ContextEdit
fn clone(&self) -> ContextEdit
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContextEdit
impl Debug for ContextEdit
Source§impl<'de> Deserialize<'de> for ContextEdit
impl<'de> Deserialize<'de> for ContextEdit
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContextEdit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContextEdit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ContextEdit
impl PartialEq for ContextEdit
Source§fn eq(&self, other: &ContextEdit) -> bool
fn eq(&self, other: &ContextEdit) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ContextEdit
impl Serialize for ContextEdit
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ContextEdit
Auto Trait Implementations§
impl Freeze for ContextEdit
impl RefUnwindSafe for ContextEdit
impl Send for ContextEdit
impl Sync for ContextEdit
impl Unpin for ContextEdit
impl UnsafeUnpin for ContextEdit
impl UnwindSafe for ContextEdit
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