pub struct ContextPackConfig {
pub max_chars: usize,
pub max_items: usize,
pub reserve_chars: usize,
pub separator: String,
}Expand description
Configuration for packing context items into a bounded model window.
Fields§
§max_chars: usizeMaximum characters available to selected item text, including separators.
max_items: usizeMaximum number of items to include.
reserve_chars: usizeCharacters reserved for instructions, user input, or other context.
separator: StringSeparator inserted between selected item text when rendering.
Implementations§
Source§impl ContextPackConfig
impl ContextPackConfig
Sourcepub fn new(max_chars: usize) -> Self
pub fn new(max_chars: usize) -> Self
Build a config with a character budget and otherwise default limits.
Sourcepub fn with_max_items(self, max_items: usize) -> Self
pub fn with_max_items(self, max_items: usize) -> Self
Set the maximum number of selected items.
Sourcepub fn with_reserve_chars(self, reserve_chars: usize) -> Self
pub fn with_reserve_chars(self, reserve_chars: usize) -> Self
Reserve part of the character budget for non-packed context.
Sourcepub fn with_separator(self, separator: impl Into<String>) -> Self
pub fn with_separator(self, separator: impl Into<String>) -> Self
Use a custom separator when rendering selected context.
Trait Implementations§
Source§impl Clone for ContextPackConfig
impl Clone for ContextPackConfig
Source§fn clone(&self) -> ContextPackConfig
fn clone(&self) -> ContextPackConfig
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 ContextPackConfig
impl Debug for ContextPackConfig
Source§impl Default for ContextPackConfig
impl Default for ContextPackConfig
Source§impl<'de> Deserialize<'de> for ContextPackConfig
impl<'de> Deserialize<'de> for ContextPackConfig
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 ContextPackConfig
impl PartialEq for ContextPackConfig
Source§fn eq(&self, other: &ContextPackConfig) -> bool
fn eq(&self, other: &ContextPackConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ContextPackConfig
impl Serialize for ContextPackConfig
impl Eq for ContextPackConfig
impl StructuralPartialEq for ContextPackConfig
Auto Trait Implementations§
impl Freeze for ContextPackConfig
impl RefUnwindSafe for ContextPackConfig
impl Send for ContextPackConfig
impl Sync for ContextPackConfig
impl Unpin for ContextPackConfig
impl UnsafeUnpin for ContextPackConfig
impl UnwindSafe for ContextPackConfig
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