ADK for TypeScript: API Reference
    Preparing search index...

    Class BaseToolAbstract

    The base class for all tools.

    Hierarchy (View Summary)

    Constructors

    Properties

    description: string
    isLongRunning: boolean
    name: string

    Accessors

    Methods

    • 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.

    • 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

      Returns Promise<void>

    • Runs the tool with the given arguments and context.

      NOTE

      • Required if this tool needs to run at the client side.
      • Otherwise, can be skipped, e.g. for a built-in GoogleSearch tool for Gemini.

      Parameters

      Returns Promise<unknown>

      A promise that resolves to the tool response.