pub struct GoogleSearchTool;tools only.Expand description
GoogleSearch is a built-in tool that is automatically invoked by Gemini models to retrieve search results from Google Search. The tool operates internally within the model and does not require or perform local code execution.
Implementations§
Source§impl GoogleSearchTool
impl GoogleSearchTool
Sourcepub fn new() -> GoogleSearchTool
pub fn new() -> GoogleSearchTool
Create a new GoogleSearchTool.
Trait Implementations§
Source§impl BypassMultiToolsLimit for GoogleSearchTool
Bypass support: convert the built-in Google Search tool into a
function-calling tool so it can be used alongside custom function tools.
impl BypassMultiToolsLimit for GoogleSearchTool
Bypass support: convert the built-in Google Search tool into a function-calling tool so it can be used alongside custom function tools.
The Gemini Interactions API forbids mixing built-in (server-side) tools with
custom function tools in one request. Implementing BypassMultiToolsLimit
mirrors ADK-Python’s bypass_multi_tools_limit=True: the converted tool
reports is_builtin() == false, declares a normal query: string function
schema, and performs grounded search by delegating to an internal
single-turn agent.
Because adk-tool cannot depend on adk-agent, the internal
grounded-search agent is supplied by the caller. It is expected to be an
LlmAgent configured with GoogleSearchTool and a Gemini model so that
the grounding happens server-side.
§Example
use adk_tool::{BypassMultiToolsLimit, GoogleSearchTool};
use std::sync::Arc;
// `search_agent` is an LlmAgent with GoogleSearchTool + a Gemini model.
let tool = GoogleSearchTool::new().with_bypass_multi_tools_limit(Arc::new(search_agent));
assert!(!tool.is_builtin());Source§fn bypass_name(&self) -> String
fn bypass_name(&self) -> String
Source§fn bypass_description(&self) -> String
fn bypass_description(&self) -> String
Source§fn bypass_parameters_schema(&self) -> Value
fn bypass_parameters_schema(&self) -> Value
Source§fn bypass_query_field(&self) -> String
fn bypass_query_field(&self) -> String
"query" for search, "url" for URL context).Source§fn with_bypass_multi_tools_limit(self, agent: Arc<dyn Agent>) -> Arc<dyn Tool> ⓘ
fn with_bypass_multi_tools_limit(self, agent: Arc<dyn Agent>) -> Arc<dyn Tool> ⓘ
BypassBuiltinTool
so it can coexist with custom function tools under the Interactions API. Read moreSource§impl Default for GoogleSearchTool
impl Default for GoogleSearchTool
Source§fn default() -> GoogleSearchTool
fn default() -> GoogleSearchTool
Source§impl Tool for GoogleSearchTool
impl Tool for GoogleSearchTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§fn is_builtin(&self) -> bool
fn is_builtin(&self) -> bool
google_search, url_context). Read more