pub struct ToolResultEnvelopeConfig {
pub max_string_chars: usize,
pub max_array_items: usize,
pub max_total_bytes: usize,
pub redaction: Option<RedactionPolicy>,
}Expand description
Configuration for bounding large tool results before they enter a model turn, trace record, or MCP response cache.
Fields§
§max_string_chars: usizeMaximum characters retained for any string value.
max_array_items: usizeMaximum items retained for any array value.
max_total_bytes: usizeMaximum serialized bytes retained for the entire bounded payload.
redaction: Option<RedactionPolicy>Optional redaction policy applied before size bounding.
Implementations§
Source§impl ToolResultEnvelopeConfig
impl ToolResultEnvelopeConfig
Sourcepub fn new(max_string_chars: usize) -> Self
pub fn new(max_string_chars: usize) -> Self
Build a config with a string character limit and otherwise default limits.
Sourcepub fn with_max_array_items(self, max_array_items: usize) -> Self
pub fn with_max_array_items(self, max_array_items: usize) -> Self
Set the maximum retained array items.
Sourcepub fn with_max_total_bytes(self, max_total_bytes: usize) -> Self
pub fn with_max_total_bytes(self, max_total_bytes: usize) -> Self
Set the maximum serialized bytes retained for the whole payload.
Sourcepub fn with_redaction_policy(self, redaction: RedactionPolicy) -> Self
pub fn with_redaction_policy(self, redaction: RedactionPolicy) -> Self
Set the redaction policy applied before truncation and total bounding.
Trait Implementations§
Source§impl Clone for ToolResultEnvelopeConfig
impl Clone for ToolResultEnvelopeConfig
Source§fn clone(&self) -> ToolResultEnvelopeConfig
fn clone(&self) -> ToolResultEnvelopeConfig
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 ToolResultEnvelopeConfig
impl Debug for ToolResultEnvelopeConfig
Source§impl Default for ToolResultEnvelopeConfig
impl Default for ToolResultEnvelopeConfig
Source§impl<'de> Deserialize<'de> for ToolResultEnvelopeConfig
impl<'de> Deserialize<'de> for ToolResultEnvelopeConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ToolResultEnvelopeConfig
impl PartialEq for ToolResultEnvelopeConfig
Source§fn eq(&self, other: &ToolResultEnvelopeConfig) -> bool
fn eq(&self, other: &ToolResultEnvelopeConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ToolResultEnvelopeConfig
impl Serialize for ToolResultEnvelopeConfig
impl Eq for ToolResultEnvelopeConfig
impl StructuralPartialEq for ToolResultEnvelopeConfig
Auto Trait Implementations§
impl Freeze for ToolResultEnvelopeConfig
impl RefUnwindSafe for ToolResultEnvelopeConfig
impl Send for ToolResultEnvelopeConfig
impl Sync for ToolResultEnvelopeConfig
impl Unpin for ToolResultEnvelopeConfig
impl UnsafeUnpin for ToolResultEnvelopeConfig
impl UnwindSafe for ToolResultEnvelopeConfig
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