# Class ComputerUseToolset

java.lang.Object
com.google.adk.tools.computeruse.ComputerUseToolset

All Implemented Interfaces:
  `BaseToolset, AutoCloseable`

public class ComputerUseToolset extends Object implements BaseToolset
A toolset that provides computer use capabilities.

It automatically discovers and wraps methods from a `BaseComputer` implementation.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ComputerUseToolset(BaseComputer computer)`
  `ComputerUseToolset(BaseComputer computer, int[] virtualScreenSize)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  Performs cleanup and releases resources held by the toolset.
  `io.reactivex.rxjava3.core.Flowable<BaseTool>`
  `getTools(ReadonlyContext readonlyContext)`
  Return all tools in the toolset based on the provided context.
  `io.reactivex.rxjava3.core.Completable`
  `processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext)`
  Adds computer use configuration to the LLM request.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface BaseToolset

  `isToolSelected`
  Modifier and Type
  Method
  Description
  `default boolean`
  `isToolSelected(BaseTool tool, @Nullable Object toolFilter, @Nullable ReadonlyContext readonlyContext)`
  Checks if a tool should be selected based on a filter.

- ## Constructor Details

  - ### ComputerUseToolset

    public ComputerUseToolset(BaseComputer computer)

  - ### ComputerUseToolset

    public ComputerUseToolset(BaseComputer computer, int[] virtualScreenSize)

- ## Method Details

  - ### getTools

    public io.reactivex.rxjava3.core.Flowable<BaseTool> getTools(ReadonlyContext readonlyContext)
    Description copied from interface: `BaseToolset`
    Return all tools in the toolset based on the provided context.
    Specified by:
      `getTools` in interface `BaseToolset`
    Parameters:
      `readonlyContext` - Context used to filter tools available to the agent.
    Returns:
      A Single emitting a list of tools available under the specified context.

  - ### close

    public void close() throws Exception
    Description copied from interface: `BaseToolset`
    Performs cleanup and releases resources held by the toolset.

    NOTE: This method is invoked, for example, at the end of an agent server's lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.

    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `BaseToolset`
    Throws:
      `Exception`

  - ### processLlmRequest

    public io.reactivex.rxjava3.core.Completable processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext)
    Adds computer use configuration to the LLM request.