A reusable Python SDK for controlling a computer-using agent in a virtual desktop.
Project description
CUA Agent SDK
A reusable, pip-installable Python SDK for controlling a computer-using agent in a virtual desktop (e.g., Docker, VNC, or any custom environment) using OpenAI CUA models. The SDK is fully configurable, class-based, and easy to integrate into any Python project.
🚀 Installation
Install from source:
pip install .
or (when published):
pip install cua-sdk
🛠️ Usage
from cua_sdk import ComputerAgent
agent = ComputerAgent(
openai_api_key="sk-...",
llm_model="computer-use-preview",
docker_container_name="cua-image",
docker_display=":99",
sleep_time=0.2,
screen_width=800,
screen_height=600,
screenshot_format="jpeg",
screenshot_detail="low",
prompt_path="prompt.txt",
# ...any other config
)
agent.start()
agent.send_prompt("Apply to this job: https://company.com/apply/123")
agent.change_config(llm_model="gpt-4.1-mini", sleep_time=0.1)
screenshot = agent.get_screenshot()
agent.reset_history()
agent.stop()
- All parameters can be set via constructor, environment variables, or config defaults.
- The agent is fully modular and can be used in any Python project.
⚙️ Configuration
Parameters (constructor, env, or config):
openai_api_keyllm_modeldocker_container_namedocker_displaysleep_timescreen_width,screen_heightscreenshot_format(jpeg/png)screenshot_detail(low/high)prompt_path- ...and more
Precedence:
Constructor argument > Environment variable > SDK default
📦 Project Structure
cua-sdk/
│
├── cua_sdk/
│ ├── __init__.py
│ ├── agent.py # Main class-based SDK
│ └── ... (other helpers)
├── setup.py
├── pyproject.toml
├── README.md
├── requirements.txt
├── examples/ # (optional) usage scripts
├── docker/ # (optional) Dockerfiles, utilities
📝 Notes
- The SDK does not require Docker or any specific environment—just pass the right config for your use case.
- Example Dockerfiles and scripts are provided in
/dockerfor convenience, but are not required for SDK use. - You can use your own prompt templates, models, and agent configuration.
🧑💻 Author
Build universal, automated desktop agents with the CUA Agent SDK!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cua_sdk-0.1.0.tar.gz.
File metadata
- Download URL: cua_sdk-0.1.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a17baf16536179271d1199de6e27c91bf1341ae38f8af53e6f0acda2812cb5a1
|
|
| MD5 |
de9721900a1bdc44f1ed9e1a9420042a
|
|
| BLAKE2b-256 |
88391e897172ce23b8df9f2438d2c41fd2a15d2eaf0b4e2013ea83d6b3429433
|
File details
Details for the file cua_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cua_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
280edfddf565eb031775eee36449754bd12596d2a2f2ce689c2ce0b45a811c39
|
|
| MD5 |
ce324d09223488385e8876cb20f568ce
|
|
| BLAKE2b-256 |
f93826014443c34b47d498f30010c0b86f2f798a47ce409bcd915759435b9864
|