diff --git a/src/askui/models/anthropic/utils.py b/src/askui/models/anthropic/utils.py index 219aee34..f82fb6b0 100644 --- a/src/askui/models/anthropic/utils.py +++ b/src/askui/models/anthropic/utils.py @@ -4,5 +4,8 @@ def extract_click_coordinates(text: str) -> tuple[int, int]: pattern = r"(\d+),\s*(\d+)" matches = re.findall(pattern, text) + if not matches: + msg = f"No click coordinates found in text: {text}" + raise ValueError(msg) x, y = matches[-1] return int(x), int(y) diff --git a/src/askui/tools/android/ppadb_agent_os.py b/src/askui/tools/android/ppadb_agent_os.py index c70efa95..77789e65 100644 --- a/src/askui/tools/android/ppadb_agent_os.py +++ b/src/askui/tools/android/ppadb_agent_os.py @@ -436,7 +436,7 @@ def _get_selected_device(self) -> AndroidDevice: devices: list[AndroidDevice] = self._get_connected_devices() if not self._device: - msg = "No device is selected, did you call on of the set_device methods?" + msg = "No device is selected, did you call one of the set_device methods?" raise AndroidAgentOsError(msg) for device in devices: @@ -447,7 +447,7 @@ def _get_selected_device(self) -> AndroidDevice: def _check_if_display_is_selected(self) -> None: if self._selected_display is None: - msg = "No display is selected, did you call on of the set_display methods?" + msg = "No display is selected, did you call one of the set_display methods?" raise AndroidAgentOsError(msg) def _get_connected_devices(self) -> list[AndroidDevice]: