Skip to main content

SDK for interacting with AutoAgents.ai API

Project description

AutoAgents-CUA-Python

Python SDK for Computer Use Agent

English | 简体中文

PyPI version License MIT

AutoAgents-CUA-Python (Computer Use Agent) is an advanced AI-powered browser automation framework that combines Large Language Models with intelligent web automation capabilities. Built on DrissionPage and powered by state-of-the-art AI models, it transforms complex web automation tasks into simple, reliable operations.

Table of Contents

Why AutoAgents CUA?

AutoAgents CUA (Computer Use Agent) is an advanced browser automation platform that combines AI intelligence with robust web automation capabilities. Built on DrissionPage and powered by Large Language Models, AutoAgents CUA transforms complex web automation tasks into simple, natural language-driven operations.

Core Capabilities

Intelligent Automation

  • AI-Powered CAPTCHA Solving: Automatically recognizes and solves image-based CAPTCHAs with 90%+ accuracy
  • Smart Form Detection: Auto-detects and fills login forms without manual configuration
  • Adaptive Retry Logic: Intelligently retries failed operations with exponential backoff
  • Natural Language Processing: Describe what you want to automate in plain language

High-Performance Architecture

  • 10-50x Faster Element Extraction: JavaScript-based batch extraction vs traditional methods
  • Shadow DOM Support: Full support for modern web components and Shadow DOM
  • Optimized Network Usage: Minimize browser-server communication overhead
  • Production-Ready Logging: Comprehensive stage-based logging for debugging and monitoring

Developer Experience

  • Zero Configuration: Get started immediately with sensible defaults
  • YAML Configuration: Flexible configuration management for complex scenarios
  • Modular Design: Use individual components or the complete automation suite
  • Extensive Examples: Ready-to-use examples in the playground directory

What Can AutoAgents CUA Do?

  • Natural Language Automation: Control browsers using natural language commands
  • Automated Login: Handle complex login flows including 2FA and CAPTCHAs
  • Data Extraction: Extract structured data from dynamic web pages
  • Form Automation: Fill and submit forms across multiple pages
  • Session Management: Maintain authenticated sessions across operations
  • Workflow Automation: Chain multiple operations into complex workflows

Technology Foundation

  • DrissionPage 4.0+: Modern browser automation framework
  • AI Models: Advanced vision models for CAPTCHA recognition
  • Python 3.11+: Built on the latest Python features
  • Loguru: Professional-grade logging system

Quick Start

Prerequisites

  • Python 3.11+
  • Chrome Browser
  • Node.js 18+ (optional, for frontend features)

Installation

# 1. Clone the repository
git clone https://github.com/your-org/AutoAgents-CUA-Python.git
cd AutoAgents-CUA-Python

# 2. Install dependencies
pip install -e .

# 3. Set up environment variables
export OPENAI_API_KEY="your-api-key"
export OPENAI_BASE_URL="https://api.openai.com/v1"
export OPENAI_MODEL="gpt-4o"

Basic Usage Example

from autoagents_cua.client import ChatClient
from autoagents_cua.models import ClientConfig, ModelConfig
from autoagents_cua.computer import Browser
from autoagents_cua.agent import BrowserAgent
from autoagents_cua.tools import ALL_WEB_TOOLS

# 1. Create LLM client
llm = ChatClient(
    client_config=ClientConfig(
        base_url="https://api.openai.com/v1",
        api_key="your-api-key"
    ),
    model_config=ModelConfig(
        name="gpt-4o",
        temperature=0.0
    )
)

# 2. Create Browser
browser = Browser(
    headless=False,
    window_size={'width': 1000, 'height': 700}
)

# 3. Create BrowserAgent
agent = BrowserAgent(
    browser=browser,
    llm=llm,
    tools=ALL_WEB_TOOLS
)

# 4. Execute tasks with natural language
agent.invoke("Please open Google and search for 'Python automation'")
agent.invoke("Click on the first search result")
agent.invoke("Extract the main content from this page")

# 5. Clean up
agent.close()

For more examples, see the playground/ directory.

Contributing

We welcome contributions from the community!

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

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

autoagents_cua-0.0.5.tar.gz (75.0 kB view details)

Uploaded Source

Built Distribution

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

autoagents_cua-0.0.5-py3-none-any.whl (53.8 kB view details)

Uploaded Python 3

File details

Details for the file autoagents_cua-0.0.5.tar.gz.

File metadata

  • Download URL: autoagents_cua-0.0.5.tar.gz
  • Upload date:
  • Size: 75.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for autoagents_cua-0.0.5.tar.gz
Algorithm Hash digest
SHA256 fbef7aaa459918c45b21616417edf5e99e347c93519d500550ef9bb446a46d84
MD5 b51c1e388042c4f50b09fba691ce5222
BLAKE2b-256 7d535fff35e4264c68dd237d40c760f2ce2028f8204bd1e898f47e3ff6588f4e

See more details on using hashes here.

File details

Details for the file autoagents_cua-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for autoagents_cua-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f8d8babffd121db4cfdfcef83019f495f090d06e788ac3302771749e98eaebbd
MD5 bcb68a8db557da8586de0e08f8a79709
BLAKE2b-256 94cc70d5252af2325a7797621dc7c3d97bd2c303300521899b8a22150f618b30

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