1919from typing import Any
2020from typing import Callable
2121
22- from google .genai import types
2322from typing_extensions import override
2423
24+ from ...features import experimental
25+ from ...features import FeatureName
2526from ...models .llm_request import LlmRequest
26- from ...utils .feature_decorator import experimental
2727from ..function_tool import FunctionTool
2828from ..tool_context import ToolContext
2929from .base_computer import ComputerState
3030
3131logger = logging .getLogger ("google_adk." + __name__ )
3232
3333
34- @experimental
34+ @experimental ( FeatureName . COMPUTER_USE )
3535class ComputerUseTool (FunctionTool ):
3636 """A tool that wraps computer control functions for use with LLMs.
3737
3838 This tool automatically normalizes coordinates from a virtual coordinate space
3939 (by default 1000x1000) to the actual screen size. This allows LLMs to work
40- with a consistent coordinate system regardless of the actual screen dimensions,
41- making their output more predictable and easier to handle.
40+ with a consistent coordinate system regardless of the actual screen
41+ dimensions, making their output more predictable and easier to handle.
4242 """
4343
4444 def __init__ (
@@ -52,13 +52,14 @@ def __init__(
5252
5353 Args:
5454 func: The computer control function to wrap.
55- screen_size: The actual screen size as (width, height) in pixels.
56- This represents the real dimensions of the target screen/display.
57- virtual_screen_size: The virtual coordinate space dimensions as (width, height)
58- that the LLM uses to specify coordinates. Coordinates from the LLM are
59- automatically normalized from this virtual space to the actual screen_size.
60- Default is (1000, 1000), meaning the LLM thinks it's working with a
61- 1000x1000 pixel screen regardless of the actual screen dimensions.
55+ screen_size: The actual screen size as (width, height) in pixels. This
56+ represents the real dimensions of the target screen/display.
57+ virtual_screen_size: The virtual coordinate space dimensions as (width,
58+ height) that the LLM uses to specify coordinates. Coordinates from the
59+ LLM are automatically normalized from this virtual space to the actual
60+ screen_size. Default is (1000, 1000), meaning the LLM thinks it's
61+ working with a 1000x1000 pixel screen regardless of the actual screen
62+ dimensions.
6263
6364 Raises:
6465 ValueError: If screen_size or virtual_screen_size is not a valid tuple
@@ -161,6 +162,5 @@ async def run_async(
161162 async def process_llm_request (
162163 self , * , tool_context : ToolContext , llm_request : LlmRequest
163164 ) -> None :
164- """ComputerUseToolset will add this tool to the LLM request and add computer
165- use configuration to the LLM request."""
165+ """ComputerUseToolset will add this tool to the LLM request and add computer use configuration to the LLM request."""
166166 pass
0 commit comments