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
Metadata
Release files for coffeeblack 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| coffeeblack-0.1.8.tar.gz | 44.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coffeeblack-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 90.4 kB
Release files / coffeeblack-0.1.8.tar.gz
| Download URL | coffeeblack-0.1.8.tar.gz |
|---|---|
| Size | 44.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b7286d52242749f02f491a3969521eb466900d72c8e39a217666f230f046b3c
|
|
BLAKE2b-256 checksum How to use checksums |
1b4b70315c55032ba297ae60558b11a22590a4d367338ae26980f4d8597e14c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.13
|
Release files / coffeeblack-0.1.8-py3-none-any.whl
| Download URL | coffeeblack-0.1.8-py3-none-any.whl |
|---|---|
| Size | 46.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b62936fc06195c0b2c73175708beca1529c529cc8aae3f6df0bb97fac5d5a0f7
|
|
BLAKE2b-256 checksum How to use checksums |
c15a1f3fcce703510024487aba22d13d190607ae1e171e05b9ce467471ccd3fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.13
|