Class FunctionTool
java.lang.Object
com.google.adk.tools.BaseTool
com.google.adk.tools.FunctionTool
- Direct Known Subclasses:
ComputerUseTool, LoadMemoryTool, LongRunningFunctionTool
FunctionTool implements a customized function calling tool.
-
Nested Class Summary
Nested classes/interfaces inherited from class BaseTool
BaseTool.ToolArgsConfig, BaseTool.ToolConfig -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFunctionTool(Object instance, Method func, boolean isLongRunning) protectedFunctionTool(Object instance, Method func, boolean isLongRunning, boolean requireConfirmation) -
Method Summary
Modifier and TypeMethodDescriptioncallLive(Map<String, Object> args, ToolContext toolContext, InvocationContext invocationContext) static FunctionToolstatic FunctionToolstatic FunctionToolstatic FunctionToolstatic FunctionToolstatic FunctionToolstatic FunctionToolstatic FunctionToolstatic FunctionToolstatic FunctionToolstatic FunctionToolstatic FunctionToolOptional<com.google.genai.types.FunctionDeclaration> Gets theFunctionDeclarationrepresentation of this tool.func()Returns the underlying functionMethod.booleanReturns true if the wrapped function returns a Flowable and can be used for streaming.runAsync(Map<String, Object> args, ToolContext toolContext) Calls a tool.Methods inherited from class BaseTool
customMetadata, description, fromConfig, longRunning, name, processLlmRequest, setCustomMetadata
-
Constructor Details
-
FunctionTool
-
FunctionTool
-
-
Method Details
-
create
-
create
-
create
public static FunctionTool create(Object instance, Method func, boolean requireConfirmation, boolean isLongRunning) -
create
-
create
-
create
-
create
-
create
-
create
public static FunctionTool create(Class<?> cls, String methodName, boolean requireConfirmation, boolean isLongRunning) -
create
-
create
-
create
public static FunctionTool create(Object instance, String methodName, boolean requireConfirmation, boolean isLongRunning) -
declaration
Description copied from class:BaseToolGets theFunctionDeclarationrepresentation of this tool.- Overrides:
declarationin classBaseTool
-
func
-
isStreaming
public boolean isStreaming()Returns true if the wrapped function returns a Flowable and can be used for streaming. -
runAsync
-
callLive
public io.reactivex.rxjava3.core.Flowable<Map<String,Object>> callLive(Map<String, Object> args, ToolContext toolContext, InvocationContext invocationContext) throws IllegalAccessException, InvocationTargetException
-