pub struct ToolConfig {Show 35 fields
pub unavailable_tool_policy: ToolAvailabilityPolicy,
pub skip_url_verification: bool,
pub enable_load_document: bool,
pub image_understanding_model: Option<String>,
pub video_understanding_model: Option<String>,
pub audio_understanding_model: Option<String>,
pub google_search_api_key: Option<String>,
pub google_search_cx: Option<String>,
pub tavily_api_key: Option<String>,
pub brave_search_api_key: Option<String>,
pub pixabay_api_key: Option<String>,
pub rapidapi_api_key: Option<String>,
pub firecrawl_api_key: Option<String>,
pub view_max_text_file_size: u64,
pub view_relaxed_text_patterns: Vec<String>,
pub view_relaxed_text_dynamic_patterns: BTreeMap<String, Vec<String>>,
pub view_relaxed_text_file_size: u64,
pub view_relaxed_line_limit: usize,
pub view_relaxed_max_line_length: usize,
pub view_max_content_chars: usize,
pub view_relaxed_max_content_chars: usize,
pub edit_max_file_size: u64,
pub grep_max_file_size: u64,
pub view_max_inline_image_bytes: u64,
pub view_max_inline_video_bytes: u64,
pub view_max_inline_audio_bytes: u64,
pub fetch_stream_chunk_size: usize,
pub fetch_max_inline_binary_bytes: u64,
pub download_max_concurrency: usize,
pub document_max_file_size: u64,
pub filesystem_output_truncate_limit: usize,
pub grep_truncation_threshold: usize,
pub grep_truncated_line_max: usize,
pub shell_output_truncate_limit: usize,
pub cold_start_tool_return_limit: usize,
}Expand description
Tool-level configuration stored on crate::AgentContext.
Fields§
Runtime behavior when a registered tool is unavailable for the current context.
skip_url_verification: boolSkip SSRF URL verification for URL-fetching tools.
enable_load_document: boolEnable document URL parsing in load-style document tools.
image_understanding_model: Option<String>Model used for image understanding fallback.
video_understanding_model: Option<String>Model used for video understanding fallback.
audio_understanding_model: Option<String>Model used for audio understanding fallback.
google_search_api_key: Option<String>Google Custom Search API key.
google_search_cx: Option<String>Google Custom Search Engine id.
tavily_api_key: Option<String>Tavily API key.
brave_search_api_key: Option<String>Brave Search API key.
pixabay_api_key: Option<String>Pixabay API key.
rapidapi_api_key: Option<String>RapidAPI key.
firecrawl_api_key: Option<String>Firecrawl API key.
view_max_text_file_size: u64Maximum text file size the view tool will inspect.
view_relaxed_text_patterns: Vec<String>Static relaxed text view path patterns.
view_relaxed_text_dynamic_patterns: BTreeMap<String, Vec<String>>Runtime relaxed text view patterns keyed by source id.
view_relaxed_text_file_size: u64Maximum text file size for relaxed text paths.
view_relaxed_line_limit: usizeDefault line limit for relaxed text paths.
view_relaxed_max_line_length: usizeDefault max line length for relaxed text paths.
view_max_content_chars: usizeMaximum returned text characters for normal view output.
view_relaxed_max_content_chars: usizeMaximum returned text characters for relaxed view output.
edit_max_file_size: u64Maximum file size edit and multi_edit will process.
grep_max_file_size: u64Maximum file size grep will read per file.
view_max_inline_image_bytes: u64Maximum image size view will inline.
view_max_inline_video_bytes: u64Maximum video size view will inline.
view_max_inline_audio_bytes: u64Maximum audio size view will inline.
fetch_stream_chunk_size: usizeChunk size for streamed HTTP reads.
fetch_max_inline_binary_bytes: u64Maximum binary response size fetch will inline.
download_max_concurrency: usizeMaximum concurrent downloads.
document_max_file_size: u64Maximum file size for document conversion tools.
filesystem_output_truncate_limit: usizeFilesystem generic output truncation limit.
grep_truncation_threshold: usizeGrep soft truncation threshold.
grep_truncated_line_max: usizeGrep matching line max characters after truncation.
shell_output_truncate_limit: usizeShell output truncation limit.
cold_start_tool_return_limit: usizeCold-start history tool return character limit.
Implementations§
Source§impl ToolConfig
impl ToolConfig
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Return whether the persisted config only contains default values.
Runtime-only dynamic relaxed patterns do not make the config persistent.
Sourcepub fn effective_view_relaxed_text_patterns(&self) -> Vec<&str>
pub fn effective_view_relaxed_text_patterns(&self) -> Vec<&str>
Return all static and runtime relaxed text patterns in deterministic order.
Sourcepub fn register_view_relaxed_text_patterns(
&mut self,
source: impl Into<String>,
patterns: impl IntoIterator<Item = String>,
)
pub fn register_view_relaxed_text_patterns( &mut self, source: impl Into<String>, patterns: impl IntoIterator<Item = String>, )
Register runtime relaxed text patterns for a source id.
Sourcepub fn unregister_view_relaxed_text_patterns(&mut self, source: &str)
pub fn unregister_view_relaxed_text_patterns(&mut self, source: &str)
Remove runtime relaxed text patterns for a source id.
Trait Implementations§
Source§impl Clone for ToolConfig
impl Clone for ToolConfig
Source§fn clone(&self) -> ToolConfig
fn clone(&self) -> ToolConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more