Skip to content

AmanT1226/AI-Agent

Repository files navigation

LMS Autonomous Payment Agent

This project uses browser-use to run an LLM-driven browser agent that navigates to a page, finds a Pay button, and proceeds with payment.

Reference followed: Browser Use Quickstart

Prerequisites

  • Python 3.11+ (Windows)
  • PowerShell 7 (pwsh)

Setup

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m ensurepip --upgrade
python -m pip install --upgrade pip setuptools wheel
python -m pip install browser-use python-dotenv playwright
python -m playwright install chromium

Configure

Copy-Item .env.example .env
# Edit .env and set keys and defaults

At minimum set one supported LLM key (OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY). Default model: gpt-4.1-mini.

Best Buy credentials (optional, recommended to set via .env instead of CLI):

BESTBUY_USERNAME=you@example.com   # optional; preferred for login if set
BESTBUY_EMAIL=you@example.com
BESTBUY_PASSWORD=your-password

Run

.\.venv\Scripts\python agent.py --url "https://example.com/checkout" --headless false --dry-run true
  • --url: Target page; if omitted, uses TARGET_URL from .env.
  • --headless: true or false (default false).
  • --dry-run: If true, the agent will NOT click; it will locate the button and report details.
  • --confirm: Set to yes to allow clicking the pay button. If not yes, click actions are disabled.
  • --labels: Comma-separated button labels to try (defaults from env PAY_BUTTON_LABELS).

Best Buy mode example (credentials pulled from .env if set):

.\.venv\Scripts\python agent.py --url "https://www.bestbuy.com" --query "iPhone 16 Pro" --dry-run true
# or to allow ordering if all checks pass (use with caution):
.\.venv\Scripts\python agent.py --url "https://www.bestbuy.com" --query "iPhone 16 Pro" --confirm yes --dry-run false

Notes

  • The agent restricts navigation to the target domain for safety.
  • Ensure you comply with site terms and have consent to automate.
  • For details on the Agent API and setup, see the Browser Use docs: Quickstart

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages