GeezerVison is showing adk.dev — GoogleSearchTool | ADK for TypeScript: API Reference - v2.5.0
A built-in tool that is automatically invoked by Gemini 2 models to retrieve
search results from Google Search.
This tool operates internally within the model and does not require or
perform local code execution.
Constructors
constructor
-
new GoogleSearchTool(): GoogleSearchTool
Properties
Readonly[BASE_TOOL_SIGNATURE_SYMBOL]
"[BASE_TOOL_SIGNATURE_SYMBOL]": true
A unique symbol to identify ADK base tool class.
Readonly[IN_MODEL_TOOL_SYMBOL]
"[IN_MODEL_TOOL_SYMBOL]": true
Marks this tool as one the model runs itself.
Readonlydescription
description: string
ReadonlyisLongRunning
isLongRunning: boolean
Readonlyname
name: string
Accessors
apiVariant
-
The Google API LLM variant to use.
Methods
_getDeclaration
-
_getDeclaration(): FunctionDeclaration | undefined
Gets the OpenAPI specification of this tool in the form of a
FunctionDeclaration.
NOTE
- Required if subclass uses the default implementation of
processLlmRequest to add function declaration to LLM request.
- Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for
Gemini.
Returns FunctionDeclaration | undefined
The FunctionDeclaration of this tool, or undefined if it doesn't
need to be added to LlmRequest.config.
ProtectedapplyBuiltInConfig
-
Adds this tool's configuration to the request.
Returns Promise<void>
checkRequireConfirmation
-
checkRequireConfirmation( _args: Record<string, unknown>, _toolContext?: Context,): Promise<boolean>
Whether this tool needs a human to approve args before it runs.
The gate itself lives in the tool that owns it (see FunctionTool), but
the resume path has to ask the same question a turn later, to check that an
approval it is about to honour belongs to a tool that gates at all. A tool
that never gates returns false here, which is the safe default: an approval
naming it is meaningless and gets rejected rather than executed. Mirrors
Python's BaseTool.check_require_confirmation.
Parameters
- _args: Record<string, unknown>
The arguments the tool would run with.
Optional_toolContext: Context
The context of the call, when there is one.
Returns Promise<boolean>
Whether the call requires confirmation.
processLlmRequest
-
Processes the outgoing LLM request for this tool.
Use cases:
- Most common use case is adding this tool to the LLM request.
- Some tools may just preprocess the LLM request before it's sent out.
Returns Promise<void>
runAsync
-
runAsync(): Promise<unknown>
Answers a function call the model should not have made. The tool is
already configured on the request and its results arrive as grounding
metadata, so the model is told to use those rather than call again.
Returns Promise<unknown>
Constructors
Properties
Accessors
Methods