Skip to content

Commit 333a4ce

Browse files
chore: improve error message to give more detailed feedback to agent
1 parent 6c3df86 commit 333a4ce

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/askui/tools/computer/move_mouse_tool.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ def _parse_coordinates(x: float | str, y: float | str) -> tuple[int, int]:
4949
_NUMBER_PATTERN = re.compile(r"-?\d+")
5050
combined = f"{x},{y}"
5151
numbers = _NUMBER_PATTERN.findall(combined)
52-
if len(numbers) < 2:
53-
error_msg = f"Could not parse coordinates from x={x!r}, y={y!r}"
52+
if not len(numbers) == 2:
53+
error_msg = f"""Could not parse mouse_move coordinates from provided
54+
parameters x={x}, y={y}. The parameters x and y must be passed as separate
55+
integer values!"""
5456
raise ValueError(error_msg)
5557
return int(numbers[0]), int(numbers[1])

0 commit comments

Comments
 (0)