Single-Step Actions in AskUI

AskUI provides a comprehensive set of single-step actions that allow you to interact with any UI element on your screen. These actions range from basic mouse clicks to complex keyboard combinations and system operations.

Core Interaction Commands

DescriptionModelsExample (Python)
click()Clicks on an element described by textAllagent.click('Login button')
expect()Asserts that an element existsAllagent.expect('Login successful')
type()Types text into a focused elementAllagent.type('username@example.com')

Tools

AskUI provides several built-in tools to interact with the operating system and applications:

DescriptionExample (Python)
osProvides OS-level operationsagent.tools.os.get_clipboard_text()
webbrowserControls web browser operationsagent.tools.webbrowser.open_new("https://askui.com")
clipboardManages clipboard operationsagent.tools.clipboard.copy("Text to copy")

Assertion and Information Commands

DescriptionModelsExample (Python)
get()Extracts text or information from the screensonnet-3.5-latesttext = agent.get('What is the value in the total field?')

Mouse Interactions

DescriptionModelsExample (Python)
mouseDoubleLeftClick()Performs a double left clickAllagent.mouseDoubleLeftClick('icon')
mouseDoubleMiddleClick()Performs a double middle clickAllagent.mouseDoubleMiddleClick('tab')
mouseDoubleRightClick()Performs a double right clickAllagent.mouseDoubleRightClick('file')
mouseLeftClick()Performs a left clickAllagent.mouseLeftClick('button')
mouseMiddleClick()Performs a middle clickAllagent.mouseMiddleClick('link')
mouseRightClick()Performs a right clickAllagent.mouseRightClick('context menu')
mouseToggleDown()Holds down a mouse buttonAllagent.mouseToggleDown('left')
mouseToggleUp()Releases a mouse buttonAllagent.mouseToggleUp('left')
moveMouse()Moves mouse to coordinatesAllagent.moveMouse(100, 200)
moveMouseRelatively()Moves mouse by offsetAllagent.moveMouseRelatively(10, 20)
moveMouseRelativelyTo()Moves mouse relative to elementAllagent.moveMouseRelativelyTo('button', 5, 5)
moveMouseTo()Moves mouse to elementAllagent.moveMouseTo('search field')

Keyboard Interactions

DescriptionModelsExample (Python)
pressAndroidKey()Presses Android-specific keyAllagent.pressAndroidKey('home')
pressAndroidTwoKey()Presses two Android keysAllagent.pressAndroidTwoKey('shift', 'home')
pressKey()Presses a keyboard keyAllagent.pressKey('enter')
pressThreeKeys()Presses three keys simultaneouslyAllagent.pressThreeKeys('ctrl', 'shift', 'esc')
pressTwoKeys()Presses two keys simultaneouslyAllagent.pressTwoKeys('ctrl', 'c')

Scrolling and Touch Interactions

DescriptionModelsExample (Python)
scroll()Scrolls the pageAllagent.scroll('down', 500)
scrollInside()Scrolls inside an elementAllagent.scrollInside('dropdown menu', 'down', 200)
swipe()Performs a swipe gestureAllagent.swipe('left', 300)