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 — LongRunningFunctionTool | ADK for TypeScript: API Reference - v2.5.0

  • LongRunningFunctionTool

Class LongRunningFunctionTool<TParameters>

A FunctionTool for long-running operations whose result is returned asynchronously.

The framework invokes the user-provided function and delivers the response back to the model once it completes, matched up by the function call's id. The model is also instructed not to re-invoke the tool while a call is already in flight.

Type Parameters

  • TParameters extends ToolInputParameters = undefined

Hierarchy (View Summary)

  • FunctionTool<TParameters>
    • LongRunningFunctionTool
  • Defined in core/src/tools/long_running_tool.ts:28

Constructors

constructor

  • new LongRunningFunctionTool<TParameters extends ToolInputParameters = undefined>(
        options: ToolOptions<TParameters>,
    ): LongRunningFunctionTool<TParameters>

    The constructor acts as the user-friendly factory.

    Type Parameters

    • TParameters extends ToolInputParameters = undefined

    Parameters

    • options: ToolOptions<TParameters>

      The configuration for the tool.

    Returns LongRunningFunctionTool<TParameters>

    Overrides FunctionTool.constructor

    • Defined in core/src/tools/long_running_tool.ts:35

Properties

Readonly[BASE_TOOL_SIGNATURE_SYMBOL]

"[BASE_TOOL_SIGNATURE_SYMBOL]": true

A unique symbol to identify ADK base tool class.

Inherited from FunctionTool.[BASE_TOOL_SIGNATURE_SYMBOL]

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

Readonly[FUNCTION_TOOL_SIGNATURE_SYMBOL]

"[FUNCTION_TOOL_SIGNATURE_SYMBOL]": true

A unique symbol to identify ADK function tool class.

Inherited from FunctionTool.[FUNCTION_TOOL_SIGNATURE_SYMBOL]

  • Defined in core/src/tools/function_tool.ts:220

Readonlydescription

description: string

Inherited from FunctionTool.description

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

ReadonlyisLongRunning

isLongRunning: boolean

Inherited from FunctionTool.isLongRunning

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

Readonlyname

name: string

Inherited from FunctionTool.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 FunctionTool.apiVariant

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

Methods

_callLive

  • _callLive(req: CallLiveToolRequest): AsyncGenerator<unknown, void, void>

    Invokes the tool in live streaming mode, injecting any active input stream from the invocation context and yielding items from the returned stream.

    Parameters

    • req: CallLiveToolRequest

      The live tool invocation request.

    Returns AsyncGenerator<unknown, void, void>

    Inherited from FunctionTool._callLive

    • Defined in core/src/tools/function_tool.ts:309

_getDeclaration

  • _getDeclaration(): FunctionDeclaration

    Returns the function declaration with an appended instruction warning the model not to re-invoke the tool while it is still running.

    Returns FunctionDeclaration

    Overrides FunctionTool._getDeclaration

    • Defined in core/src/tools/long_running_tool.ts:43

checkRequireConfirmation

  • checkRequireConfirmation(
        args: Record<string, unknown>,
        toolContext?: Context,
    ): Promise<boolean>

    Whether this call is gated on human approval — the static flag, or the predicate evaluated against the validated arguments.

    Parameters

    • args: Record<string, unknown>

      The arguments the tool would run with.

    • OptionaltoolContext: Context

      The context of the call, when there is one.

    Returns Promise<boolean>

    Whether the call requires confirmation.

    Inherited from FunctionTool.checkRequireConfirmation

    • Defined in core/src/tools/function_tool.ts:350

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 FunctionTool.processLlmRequest

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

runAsync

  • runAsync(req: RunAsyncToolRequest): Promise<unknown>

    Invokes the user-defined execute function with the model-provided arguments, after parsing them when parameters is a Zod object schema. Any other parameters value is passed through unchecked.

    Parameters

    • req: RunAsyncToolRequest

      The tool request containing arguments and tool context.

    Returns Promise<unknown>

    A promise resolving to the function's return value.

    Throws

    Wrapped as Error in tool '<name>': … when a Zod parameters schema rejects the arguments or execute throws.

    Inherited from FunctionTool.runAsync

    • Defined in core/src/tools/function_tool.ts:283
Constructors
constructor
Properties
[BASE_TOOL_SIGNATURE_SYMBOL][FUNCTION_TOOL_SIGNATURE_SYMBOL]descriptionisLongRunningname
Accessors
apiVariant
Methods
_callLive_getDeclarationcheckRequireConfirmationprocessLlmRequestrunAsync
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.