Class ComputerUseTool
java.lang.Object
com.google.adk.tools.BaseTool
com.google.adk.tools.FunctionTool
com.google.adk.tools.computeruse.ComputerUseTool
A tool that wraps computer control functions for use with LLMs.
This tool automatically normalizes coordinates from a virtual coordinate space (by default 1000x1000) to the actual screen size.
-
Nested Class Summary
Nested classes/interfaces inherited from class BaseTool
BaseTool.ToolArgsConfig, BaseTool.ToolConfigModifier and TypeClassDescriptionstatic classConfiguration class for tool arguments that allows arbitrary key-value pairs.static classConfiguration class for a tool definition in YAML/JSON. -
Constructor Summary
ConstructorsConstructorDescriptionComputerUseTool(Object instance, Method func, int[] screenSize, int[] virtualScreenSize) -
Method Summary
Methods inherited from class FunctionTool
callLive, create, create, create, create, create, create, create, create, create, create, create, create, declaration, func, isStreamingModifier 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.Methods inherited from class BaseTool
customMetadata, description, fromConfig, longRunning, name, processLlmRequest, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, setCustomMetadataModifier and TypeMethodDescriptionReturns a read-only view of the tool metadata.static BaseToolfromConfig(BaseTool.ToolConfig config, String configAbsPath) Creates a tool instance from a config.booleanname()io.reactivex.rxjava3.core.CompletableprocessLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) Processes the outgoingLlmRequest.Builder.final <I,O> io.reactivex.rxjava3.core.Single <O> runAsync(I args, ToolContext toolContext, com.fasterxml.jackson.core.type.TypeReference<? extends O> typeReference) Calls a tool with generic arguments, returning the results converted to a specified type reference.final <I,O> io.reactivex.rxjava3.core.Single <O> runAsync(I args, ToolContext toolContext, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.core.type.TypeReference<? extends O> typeReference) Calls a tool with generic arguments and a customObjectMapper, returning the results converted to a specified type reference.final <I,O> io.reactivex.rxjava3.core.Single <O> runAsync(I args, ToolContext toolContext, com.fasterxml.jackson.databind.ObjectMapper objectMapper, Class<? extends O> oClass) Calls a tool with generic arguments and a customObjectMapper, returning the results converted to a specified class.final <I,O> io.reactivex.rxjava3.core.Single <O> runAsync(I args, ToolContext toolContext, Class<? extends O> oClass) Calls a tool with generic arguments, returning the results converted to a specified class.runAsync(T args, ToolContext toolContext) Calls a tool with generic arguments and returns a map of results.runAsync(T args, ToolContext toolContext, com.fasterxml.jackson.databind.ObjectMapper objectMapper) Calls a tool with generic arguments using a customObjectMapperand returns a map of results.voidsetCustomMetadata(String key, Object value) Sets custom metadata to the tool associated with a key.
-
Constructor Details
-
ComputerUseTool
-
-
Method Details
-
runAsync
public io.reactivex.rxjava3.core.Single<Map<String,Object>> runAsync(Map<String, Object> args, ToolContext toolContext) Description copied from class:BaseToolCalls a tool.- Overrides:
runAsyncin classFunctionTool
-