Skip to content

Commit

Permalink
default click/enter for type
Browse files Browse the repository at this point in the history
  • Loading branch information
yadonglu committed Feb 13, 2025
1 parent d60460d commit 9956bef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions omnitool/gradio/tools/computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ async def __call__(
return ToolResult(output=f"Pressed keys: {text}")

elif action == "type":
# default click before type TODO: check if this is needed
self.send_to_vm("pyautogui.click()")
self.send_to_vm(f"pyautogui.typewrite('{text}', interval={TYPING_DELAY_MS / 1000})")
self.send_to_vm("pyautogui.press('enter')")
screenshot_base64 = (await self.screenshot()).base64_image
return ToolResult(output=text, base64_image=screenshot_base64)

Expand Down

0 comments on commit 9956bef

Please sign in to comment.