Metadata-Version: 2.4
Name: hud-python
Version: 0.2.0
Summary: SDK for the HUD evaluation platform.
Project-URL: Homepage, https://github.com/Human-Data/hud-sdk
Project-URL: Bug Tracker, https://github.com/Human-Data/hud-sdk/issues
Project-URL: Documentation, https://hud.so
Author-email: Human Union Data SDK <founders@hud.so>
License: MIT License
        
        Copyright (c) 2025 Human Union Data, Inc
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: <3.14,>=3.10
Requires-Dist: aiodocker>=0.24.0
Requires-Dist: httpx<1,>=0.23.0
Requires-Dist: inspect-ai>=0.3.80
Requires-Dist: pillow>=11.1.0
Requires-Dist: pydantic-settings<3,>=2
Requires-Dist: pydantic<3,>=2
Requires-Dist: textdistance<5,>=4.5.0
Requires-Dist: toml>=0.10.2
Provides-Extra: dev
Requires-Dist: anthropic; extra == 'dev'
Requires-Dist: dotenv; extra == 'dev'
Requires-Dist: ipykernel; extra == 'dev'
Requires-Dist: ipython<9; extra == 'dev'
Requires-Dist: jupyter-client; extra == 'dev'
Requires-Dist: jupyter-core; extra == 'dev'
Requires-Dist: openai; extra == 'dev'
Requires-Dist: pyright==1.1.364; extra == 'dev'
Requires-Dist: pytest<9,>=8.1.1; extra == 'dev'
Requires-Dist: ruff==0.9.8; extra == 'dev'
Description-Content-Type: text/markdown

# HUD SDK - Human-Agent Interaction Toolkit

A Python SDK for creating, evaluating, and benchmarking agent interactions with web browsers and OS environments.

> **Early Release Notice**: This SDK is currently in early release status. The API is evolving and may change in future releases as we gather feedback and improve functionality.

[![PyPI version](https://img.shields.io/pypi/v/hud-python)](https://pypi.org/project/hud-python/)

[📚 Documentation](https://documentation.hud.so) | [🏠 Homepage](https://hud.so)

## API Key Setup

Before getting started, you'll need to obtain an API key:

1. Visit [app.hud.so](https://app.hud.so) to create a free account and generate your API key
2. Set it in your environment or .env file:

```bash
export HUD_API_KEY=your_api_key_here
```

## Quick Start

### Installation

```bash
pip install hud-python
```

### Simple Browser Example with Operator

> This example uses the `@job("test-run")` decorator, so the results of this run will appear under the job named "test-run" on the your [HUD Jobs page](https://app.hud.so/jobs).

```python
import os
import asyncio
from hud import gym, job
from hud.task import Task
from hud.utils import stream
from hud.agent import OperatorAgent

@job("test-run")
async def main():
    # Define a simple task
    task = Task(
        prompt="Insert the text 'capybara' into the search bar",
        gym="hud-browser",
        setup=("goto", "google.com"),
        evaluate=("contains_text", "capybara")
    )
    
    # Create environment
    env = await gym.make(task)
    
    # Get URLs and display live view (optional)
    # urls = await env.get_urls()
    # stream(urls["live_url"])
    
    # Initialize Operator agent (API key is loaded automatically)
    agent = OperatorAgent()
    
    # Agent loop
    obs, _ = env.reset()
    for i in range(5):
        actions, done = await agent.predict(obs)
        if done:
            break
        
        obs, reward, terminated, info = await env.step(actions)
        if terminated:
            break
    
    # Evaluate and close
    result = await env.evaluate()
    print(f"Evaluation result: {result}")
    await env.close()

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

```

## Documentation Sections

Explore the core concepts and features of the SDK:

*   **[Tasks and TaskSets](/concepts/task)**: Define goals, context, setup, and evaluation criteria for agent scenarios.
*   **[Environments](/concepts/environment)**: Understand the browser and OS runtimes where agents interact.
*   **[Agents](/concepts/agent)**: Learn about the agent architecture (Claude, Operator) and how they process observations and predict actions.
*   **[Adapters](/concepts/adapter)**: See how actions and observations are translated between agents and environments.
*   **[Jobs](/concepts/job)**: Group related runs for analysis and viewing on the HUD platform.
*   **[Trajectories](/concepts/trajectory)**: Understand the recorded data from each agent run.
*   **Advanced Topics**:
    *   **[Custom Environments](/advanced/custom-environments)**: Build your own Docker-based local or remote environments.
    *   **[Advanced Environment Control](/advanced/environment-control)**: Use `invoke`, `execute`, and `_setup` for finer control.
    *   **[CLA Action Details](/advanced/cla-details)**: Dive deeper into the standardized action format.

*   **[Full API Reference](/api-reference/gym)**: Detailed specifications for all modules and classes.

## [Examples](examples/)

We provide several example notebooks showing how to use the HUD SDK:

1. [Browser Basics](examples/browser_use.ipynb) - Simple browser interaction with live view
2. [Task Design](examples/tasks.ipynb) - Creating and customizing tasks
3. [OSWorld](examples/osworld.ipynb) - Working with OS environments
4. [Local Development](examples/local.ipynb) - Setting up local custom environments

## Documentation

For comprehensive guides, examples, and API reference, visit [our docs](https://docs.hud.so/introduction)

## License

[MIT License](LICENSE)

## Citation

If you use this SDK in your research, please cite it as follows:

```bibtex
@software{hud2025agentevalplatform,
  author = {HUD and Jay Ram and Lorenss Martinsons and Parth Patel and Max Muoto and Oskars Putans and Govind Pimpale and Mayank Singamreddy and Nguyen Nhat Minh},
  title = {{HUD: An Evaluation Platform for Computer Use Agents}},
  date = {2025-03},
  url = {https://github.com/Human-Data/hud-sdk},
  langid = {en}
}
```