GeezerVison is showing adk.dev — LongRunningFunctionTool | ADK for TypeScript: API Reference - v2.5.0
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.
Constructors
constructor
-
The constructor acts as the user-friendly factory.
Returns LongRunningFunctionTool<TParameters>
Properties
Readonly[BASE_TOOL_SIGNATURE_SYMBOL]
"[BASE_TOOL_SIGNATURE_SYMBOL]": true
A unique symbol to identify ADK base tool class.
Readonly[FUNCTION_TOOL_SIGNATURE_SYMBOL]
"[FUNCTION_TOOL_SIGNATURE_SYMBOL]": true
A unique symbol to identify ADK function tool class.
Readonlydescription
description: string
ReadonlyisLongRunning
isLongRunning: boolean
Readonlyname
name: string
Accessors
apiVariant
-
The Google API LLM variant to use.
Methods
_callLive
-
Invokes the tool in live streaming mode, injecting any active input stream
from the invocation context and yielding items from the returned stream.
Returns AsyncGenerator<unknown, void, void>
_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
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.
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
-
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.
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.
Constructors
Properties
Accessors
Methods