In this quickstart tutorial, we will guide you through your first automation on a web calculator. We will calculate 7 + 7 and then extract the calculation result in a variable.

1

Install AskUI Agent OS

First, download and install the AskUI Agent OS for your operating system:

2

Install Python Package

Install the AskUI Python package:

pip install askui

Note: Requires Python version >=3.10.

3

Set Up Authentication

Set up authentication with your chosen AI model provider:

4

Create Your First Automation

Create a new Python file main.py and add the following code:

from askui import VisionAgent

# Initialize your agent context manager
with VisionAgent() as agent:
    # Use the webbrowser tool to start browsing
    agent.tools.webbrowser.open_new("http://www.amazon.com")

    agent.wait(3)
    agent.click("Search Amazon.de inputfield")
    agent.type("nike shoes")
    agent.keyboard('enter')

    agent.act("""
    You are testing amazon.de for functionality and have searched for nike shoes.
    Simulate a online shopper:

    Look for the first option which is below Results and click on the first picture from the left

    """)

    agent.click("Add to Basket")

    agent.act("""
    You are testing amazon.de for functionality and have searched for nike shoes.
    Simulate a online shopper:

    Go to the basket
    """)

    basket_ver = agent.get("Is the shoe in the basket and is a value calculated?")
    print(basket_ver)

Run the script:

python main.py
5

(Optional) Enable Detailed Logging

To better understand what your agent is doing, enable debug logging and reporting:

import logging
from askui import VisionAgent

with VisionAgent(log_level=logging.DEBUG, enable_report=True) as agent:
    # Your automation code here
6

(Optional) Run in CI/CD Pipeline

You can run your automations in any CI/CD pipeline. Here’s an example for GitHub Actions:

name: AskUI Automation
on: [push]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.10'
      - name: Install dependencies
        run: |
          pip install askui
      - name: Run automation
        env:
          ASKUI_WORKSPACE_ID: ${{ secrets.ASKUI_WORKSPACE_ID }}
          ASKUI_TOKEN: ${{ secrets.ASKUI_TOKEN }}
        run: python calculator.py

You can also find more examples in our Community.