pub struct ModelConfig {Show 16 fields
pub context_window: Option<u64>,
pub proactive_context_management_threshold: Option<PerThousandRatio>,
pub compact_threshold: PerThousandRatio,
pub cold_start_trim_seconds: u64,
pub stream_resume_on_error: bool,
pub stream_resume_max_attempts: usize,
pub stream_resume_prompt: Option<String>,
pub max_images: usize,
pub max_videos: usize,
pub support_gif: bool,
pub max_image_bytes: usize,
pub max_image_dimension: usize,
pub split_large_images: bool,
pub image_split_max_height: usize,
pub image_split_overlap: usize,
pub capabilities: BTreeSet<ModelCapability>,
}Expand description
Runtime model configuration stored on crate::AgentContext.
Fields§
§context_window: Option<u64>Context window in tokens.
proactive_context_management_threshold: Option<PerThousandRatio>Parts-per-thousand threshold where proactive context reminders should begin.
compact_threshold: PerThousandRatioParts-per-thousand threshold where compacting becomes urgent.
cold_start_trim_seconds: u64Cold-start gap in seconds before older tool returns are aggressively trimmed.
stream_resume_on_error: boolWhether stream retry recovery should resume after provider stream errors.
stream_resume_max_attempts: usizeMaximum stream retry resume attempts.
stream_resume_prompt: Option<String>Optional prompt used when resuming a failed stream.
max_images: usizeMaximum number of images retained for model input.
max_videos: usizeMaximum number of videos retained for model input.
support_gif: boolWhether GIF input is supported.
max_image_bytes: usizeMaximum image bytes after base64 encoding before compression applies.
A value of 0 disables the byte limit without disabling the independent
image dimension limit.
max_image_dimension: usizeMaximum width or height accepted for model image input.
A value of 0 disables the dimension limit without disabling the
independent encoded-byte limit.
split_large_images: boolWhether large images should be split where supported.
image_split_max_height: usizeMaximum split image height.
image_split_overlap: usizePixel overlap between split image segments.
capabilities: BTreeSet<ModelCapability>Explicit model capabilities.
Implementations§
Source§impl ModelConfig
impl ModelConfig
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Return whether the config only contains default values.
Sourcepub const fn has_runtime_context_window(&self) -> bool
pub const fn has_runtime_context_window(&self) -> bool
Return whether a context-window value should be rendered into runtime context.
Sourcepub fn has_capability(&self, capability: &ModelCapability) -> bool
pub fn has_capability(&self, capability: &ModelCapability) -> bool
Return whether a capability is present.
Sourcepub fn has_vision(&self) -> bool
pub fn has_vision(&self) -> bool
Return whether the model supports vision.
Sourcepub fn has_video_understanding(&self) -> bool
pub fn has_video_understanding(&self) -> bool
Return whether the model supports video understanding.
Sourcepub fn has_audio_understanding(&self) -> bool
pub fn has_audio_understanding(&self) -> bool
Return whether the model supports audio understanding.
Sourcepub fn has_document_understanding(&self) -> bool
pub fn has_document_understanding(&self) -> bool
Return whether the model supports document understanding.
Sourcepub fn merge_from(&mut self, other: Self)
pub fn merge_from(&mut self, other: Self)
Merge non-empty values from another config into this one.
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Source§fn clone(&self) -> ModelConfig
fn clone(&self) -> ModelConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more