#[non_exhaustive]pub enum ToolConfig {
Bash {},
Filesystem {},
WebSearch {},
WebFetch {},
CodeExecution {},
Custom {
name: String,
description: Option<String>,
input_schema: Value,
},
}Expand description
Tool declaration: built-in or custom (client-executed).
Built-in tools execute server-side in the sandbox. Custom tools are
client-executed — the runtime parks the loop until the client returns
a result via user.custom_tool_result.
§Wire Shapes (CANON §3.7)
{"type": "bash"}
{"type": "filesystem"}
{"type": "web_search"}
{"type": "web_fetch"}
{"type": "code_execution"}
{"type": "custom", "name": "get_weather", "input_schema": {"type": "object"}}§Example
use adk_managed::types::ToolConfig;
use serde_json::json;
let tool = ToolConfig::Custom {
name: "get_weather".to_string(),
description: Some("Get current weather".to_string()),
input_schema: json!({"type": "object", "properties": {"city": {"type": "string"}}}),
};
let json = serde_json::to_string(&tool).unwrap();
assert!(json.contains(r#""type":"custom""#));
assert!(json.contains(r#""name":"get_weather""#));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Bash
Bash shell execution tool (server-side).
Filesystem
Filesystem access tool (server-side).
WebSearch
Web search tool (server-side).
WebFetch
Web fetch/scrape tool (server-side).
CodeExecution
Code execution tool (server-side).
Custom
Custom client-executed tool.
Trait Implementations§
Source§impl Clone for ToolConfig
impl Clone for ToolConfig
Source§fn clone(&self) -> ToolConfig
fn clone(&self) -> ToolConfig
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 ToolConfig
impl Debug for ToolConfig
Source§impl<'de> Deserialize<'de> for ToolConfig
impl<'de> Deserialize<'de> for ToolConfig
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
Auto Trait Implementations§
impl Freeze for ToolConfig
impl RefUnwindSafe for ToolConfig
impl Send for ToolConfig
impl Sync for ToolConfig
impl Unpin for ToolConfig
impl UnsafeUnpin for ToolConfig
impl UnwindSafe for ToolConfig
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