diff --git a/src/agents/computer.py b/src/agents/computer.py index dca2f155b7..137a174037 100644 --- a/src/agents/computer.py +++ b/src/agents/computer.py @@ -21,38 +21,47 @@ def dimensions(self) -> tuple[int, int] | None: @abc.abstractmethod def screenshot(self) -> str: + """Take a screenshot and return the base64-encoded image data.""" pass @abc.abstractmethod def click(self, x: int, y: int, button: Button) -> None: + """Click a mouse button at the given (x, y) screen coordinates.""" pass @abc.abstractmethod def double_click(self, x: int, y: int) -> None: + """Double-click at the given (x, y) screen coordinates.""" pass @abc.abstractmethod def scroll(self, x: int, y: int, scroll_x: int, scroll_y: int) -> None: + """Scroll at the given (x, y) coordinates by (scroll_x, scroll_y) units.""" pass @abc.abstractmethod def type(self, text: str) -> None: + """Type the given text at the current cursor position.""" pass @abc.abstractmethod def wait(self) -> None: + """Wait for the computer to be ready for the next action.""" pass @abc.abstractmethod def move(self, x: int, y: int) -> None: + """Move the mouse cursor to the given (x, y) screen coordinates.""" pass @abc.abstractmethod def keypress(self, keys: list[str]) -> None: + """Press one or more keys simultaneously (e.g. ``["ctrl", "c"]``).""" pass @abc.abstractmethod def drag(self, path: list[tuple[int, int]]) -> None: + """Click-and-drag the mouse along the sequence of (x, y) waypoints.""" pass @@ -72,36 +81,45 @@ def dimensions(self) -> tuple[int, int] | None: @abc.abstractmethod async def screenshot(self) -> str: + """Take a screenshot and return the base64-encoded image data.""" pass @abc.abstractmethod async def click(self, x: int, y: int, button: Button) -> None: + """Click a mouse button at the given (x, y) screen coordinates.""" pass @abc.abstractmethod async def double_click(self, x: int, y: int) -> None: + """Double-click at the given (x, y) screen coordinates.""" pass @abc.abstractmethod async def scroll(self, x: int, y: int, scroll_x: int, scroll_y: int) -> None: + """Scroll at the given (x, y) coordinates by (scroll_x, scroll_y) units.""" pass @abc.abstractmethod async def type(self, text: str) -> None: + """Type the given text at the current cursor position.""" pass @abc.abstractmethod async def wait(self) -> None: + """Wait for the computer to be ready for the next action.""" pass @abc.abstractmethod async def move(self, x: int, y: int) -> None: + """Move the mouse cursor to the given (x, y) screen coordinates.""" pass @abc.abstractmethod async def keypress(self, keys: list[str]) -> None: + """Press one or more keys simultaneously (e.g. ``["ctrl", "c"]``).""" pass @abc.abstractmethod async def drag(self, path: list[tuple[int, int]]) -> None: + """Click-and-drag the mouse along the sequence of (x, y) waypoints.""" pass