Skip to main content

A library for automating web tasks

Project description

Web-operator

A library for automating web tasks, built extensively using LangGraph and other tools.

While it leverages browser capabilities, its current functionality is focused on specific web tasks. It's not designed for arbitrary web automation.

This library excels at tasks solvable by its defined set of agents.

Requirement

This required an Nvidia GPU with 12GB of VRAM to run the Hugging Face model locally. It also required the Gemini API.

Installation

  1. Setup conda enviornment with python 3.12

  2. Web-operator and other software installation

    conda config --add channels pytorch
    conda config --add channels conda-forge
    conda config --add channels nvidia
    
    python -m pip install --upgrade web-operator
    python -m pip install git+https://github.com/huggingface/transformers@f3f6c86582611976e72be054675e2bf0abb5f775
    
    
    
  3. Environment Setup

    This guide explains how to set up and manage environment variables for your project using python-dotenv.

    a. Install the python-dotenv library using pip:

    pip install python-dotenv
    

    b. Create a .env file in your project's root directory with the following structure:

    GEMINI_API_KEY=your_openai_api_key
    

    c. Add .env to your .gitignore file to prevent accidentally committing sensitive information:

    d. code for load environment variables

    from dotenv import load_dotenv
    import os
    load_dotenv()
    

Usecase

please see the examples folder for a simple websearch usecase.

How to change the basic config

  1. print config
print(supervisor.config)

#Typical output
{'debug': False, 'step_creation_model': 'gemini-2.0-pro-exp-02-05', 'computer_use_model': 'Qwen/Qwen2.5-VL-7B-Instruct'}
  1. modify
supervisor.config["debug"] = True
print(supervisor.config)

#Typical output
{'debug': False, 'step_creation_model': 'gemini-2.0-pro-exp-02-05', 'computer_use_model': 'Qwen/Qwen2.5-VL-7B-Instruct'}
  1. Sample full code
from web_operator.supervisor import Supervisor
from dotenv import load_dotenv

load_dotenv()  

query = """
action 1: open the firfox web browser
action 1.1: click on the address bar
action 2: type scholar.google.com 
action 3: press enter for search
action 4: type openai in the search box of google scholar
action 5: press enter for search
action 6: click on the address bar
action 7: press ctrl and a
action 7.1:press ctrl and c
action 8: scroll down 
action 9: click on the next button 
action 10: click on the address bar
action 11: press ctrl and a
action 12: press ctrl and c
action 13: close the browser
"""
user_query = query

supervisor = Supervisor()

supervisor.config["debug"] = True

# Make sure the config is changed before the configure function call.
supervisor.configure()
supervisor.run(user_query)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

web_operator-1.0.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

web_operator-1.0.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file web_operator-1.0.0.tar.gz.

File metadata

  • Download URL: web_operator-1.0.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for web_operator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 519de44efb291cf883de6cdb58eed2bc49bcb9565973871af8e8dd2b7c4892d4
MD5 a7e564b8dfead532de0f6b6810f958eb
BLAKE2b-256 e62c7442a3d40f139fec3694dbfecd8ec695edd2d792b4f0dfab2b9b878e4a30

See more details on using hashes here.

File details

Details for the file web_operator-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: web_operator-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for web_operator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0213efc117e9ab862d6299d88a76c0150b61a9004e03fd79d71d6de4405b1f8
MD5 4a7f9aca548380ea6e13a6faabea95ce
BLAKE2b-256 36fc3d314d57860bc154b4172929b2db468970ce20088bedf23ab4710cbbcec3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page