GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • ADK for TypeScript: API Reference

This view

  • Original page
  • New address

GeezerVison is showing adk.dev — GoogleSearchTool | ADK for TypeScript: API Reference - v2.5.0

  • GoogleSearchTool

Class GoogleSearchTool

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.

Hierarchy (View Summary)

  • BuiltInTool
    • GoogleSearchTool
  • Defined in core/src/tools/google_search_tool.ts:20

Constructors

constructor

  • new GoogleSearchTool(): GoogleSearchTool

    Returns GoogleSearchTool

    Overrides BuiltInTool.constructor

    • Defined in core/src/tools/google_search_tool.ts:21

Properties

Readonly[BASE_TOOL_SIGNATURE_SYMBOL]

"[BASE_TOOL_SIGNATURE_SYMBOL]": true

A unique symbol to identify ADK base tool class.

Inherited from BuiltInTool.[BASE_TOOL_SIGNATURE_SYMBOL]

  • Defined in core/src/tools/base_tool.ts:83

Readonly[IN_MODEL_TOOL_SYMBOL]

"[IN_MODEL_TOOL_SYMBOL]": true

Marks this tool as one the model runs itself.

Inherited from BuiltInTool.[IN_MODEL_TOOL_SYMBOL]

  • Defined in core/src/tools/built_in_tool.ts:34

Readonlydescription

description: string

Inherited from BuiltInTool.description

  • Defined in core/src/tools/base_tool.ts:86

ReadonlyisLongRunning

isLongRunning: boolean

Inherited from BuiltInTool.isLongRunning

  • Defined in core/src/tools/base_tool.ts:87

Readonlyname

name: string

Inherited from BuiltInTool.name

  • Defined in core/src/tools/base_tool.ts:85

Accessors

apiVariant

  • get apiVariant(): GoogleLLMVariant

    The Google API LLM variant to use.

    Returns GoogleLLMVariant

    Inherited from BuiltInTool.apiVariant

    • Defined in core/src/tools/base_tool.ts:198

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.

    Inherited from BuiltInTool._getDeclaration

    • Defined in core/src/tools/base_tool.ts:113

ProtectedapplyBuiltInConfig

  • applyBuiltInConfig(request: ToolProcessLlmRequest): Promise<void>

    Adds this tool's configuration to the request.

    Parameters

    • request: ToolProcessLlmRequest

      The request to process the LLM request.

    Returns Promise<void>

    Overrides BuiltInTool.applyBuiltInConfig

    • Defined in core/src/tools/google_search_tool.ts:25

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.

    Inherited from BuiltInTool.checkRequireConfirmation

    • Defined in core/src/tools/base_tool.ts:144

processLlmRequest

  • processLlmRequest(request: ToolProcessLlmRequest): Promise<void>

    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.

    Parameters

    • request: ToolProcessLlmRequest

      The request to process the LLM request.

    Returns Promise<void>

    Inherited from BuiltInTool.processLlmRequest

    • Defined in core/src/tools/built_in_tool.ts:45

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>

    Inherited from BuiltInTool.runAsync

    • Defined in core/src/tools/built_in_tool.ts:82
Constructors
constructor
Properties
[BASE_TOOL_SIGNATURE_SYMBOL][IN_MODEL_TOOL_SYMBOL]descriptionisLongRunningname
Accessors
apiVariant
Methods
_getDeclarationapplyBuiltInConfigcheckRequireConfirmationprocessLlmRequestrunAsync
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.