Metadata-Version: 2.4
Name: autotune-hook
Version: 0.1.0
Summary: Autotune Hook
Author: Autotune
License-Expression: LicenseRef-Proprietary
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Autotune Hook

Python hook for wrapping OpenRouter calls with AutoTune workflow policy.

```python
from autotune_hook import AutotuneHook

hook = AutotuneHook(workflow="email-triage")

def call_openrouter(payload):
    return hook.openrouter_call(
        payload,
        lambda: openrouter_client.chat.completions.create(**payload),
    )
```

Decorator form:

```python
@hook.openrouter()
def call_openrouter(**payload):
    return openrouter_client.chat.completions.create(**payload)
```

Configuration defaults to environment variables:

- `AUTOTUNE_ENDPOINT`
- `AUTOTUNE_API_KEY`
- `AUTOTUNE_WORKFLOW`
- `AUTOTUNE_PROJECT`
- `AUTOTUNE_ENVIRONMENT`
- `AUTOTUNE_SESSION_ID`
- `AUTOTUNE_USER_ID`

The hook sends the OpenRouter request to AutoTune first. A JSON boolean response
means shadow mode, so the wrapped provider call executes and its output is
reported in the background. A non-boolean AutoTune response is returned directly.
