Skip to main content

Python client for interacting with the CoffeeBlack visual reasoning API

Project description

CoffeeBlack SDK

Python client for interacting with the CoffeeBlack visual reasoning API.

Installation

You can install the package using pip:

# Install from PyPI
pip install coffeeblack

# Install from local directory
pip install -e .

# Or install from GitHub
pip install git+https://github.com/coffeeblack/sdk.git

Features

  • Find and interact with windows on your system
  • Take screenshots and send them to the CoffeeBlack API
  • Execute actions based on natural language queries
  • Reason about UI elements without executing actions
  • Find and launch applications with semantic search

Quick Start

import asyncio
import os
from coffeeblack import Argus

async def main():
    # Initialize the SDK with API key for authentication
    # You can provide your API key directly or through an environment variable
    api_key = os.environ.get("COFFEEBLACK_API_KEY")
    sdk = Argus(
        api_key=api_key,  # API key for authentication
        verbose=True,
        debug_enabled=True,
        elements_conf=0.2,
        rows_conf=0.4,
        model="ui-detect"  # Set the UI detection model to use (cua, ui-detect, or ui-tars)
    )
    
    # Define the browser name
    browser_name = "Safari" 
    
    try:
        # Open and attach to the browser
        await sdk.open_and_attach_to_app(browser_name, wait_time=2.0)

        # Execute an action based on a natural language query
        await sdk.execute_action("Type https://www.google.com into the url bar")
        
        # Press enter key
        await sdk.press_key("enter")
    
    except Exception as e:
        print(f"Error: {e}")

if __name__ == "__main__":
    asyncio.run(main())

License

MIT

Documentation

For more detailed documentation, please visit https://docs.coffeeblack.ai

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

coffeeblack-0.1.5.tar.gz (43.0 kB view details)

Uploaded Source

Built Distribution

coffeeblack-0.1.5-py3-none-any.whl (45.5 kB view details)

Uploaded Python 3

File details

Details for the file coffeeblack-0.1.5.tar.gz.

File metadata

  • Download URL: coffeeblack-0.1.5.tar.gz
  • Upload date:
  • Size: 43.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for coffeeblack-0.1.5.tar.gz
Algorithm Hash digest
SHA256 88e632e6316ec6bc2d212620606a6cf007738e16db76e54abe95a8251c541567
MD5 d47ec9d31546d2a02aa3331651cd9e6c
BLAKE2b-256 0e30260744ca462a2eb949cc53fc8899f9d7269b6db9c8f342b056d68d055886

See more details on using hashes here.

File details

Details for the file coffeeblack-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: coffeeblack-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 45.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for coffeeblack-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2de1f29058de85de126d0328b7a88408bfd9393d71a82947592cc69d00e0a238
MD5 29162200a98629b22c6c2dc8401b0a05
BLAKE2b-256 2967dcfe5a6b3f0ed89f756495d39fc0bffa90c1bae6aaf59f479ffd710c5742

See more details on using hashes here.

Supported by

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