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.12.tar.gz (46.8 kB view details)

Uploaded Source

Built Distribution

coffeeblack-0.1.12-py3-none-any.whl (50.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: coffeeblack-0.1.12.tar.gz
  • Upload date:
  • Size: 46.8 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.12.tar.gz
Algorithm Hash digest
SHA256 47ab0c79300179b0e34c38f0ad7b17448eb440f80d29195c1494c95806604fb4
MD5 ffea564085fa1f2bed5f777f229109be
BLAKE2b-256 11c574d1cf9956f0a775b9021bddf5a8da8f7fc248c9058d7bf1ef6ac60a0f25

See more details on using hashes here.

File details

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

File metadata

  • Download URL: coffeeblack-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 50.7 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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 729204dac05db81cdb2f2e72d4d7f41df931198f868328aa02aaeb0eb2312166
MD5 0a4d9e94d57be2642dd8ba27f52f5c5c
BLAKE2b-256 3a155fb598ce50d0e2e893be0f59a84bdabdae1d1f1fbe93215b7936111fa0cd

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