Metadata-Version: 2.5
Name: ampup-harness
Version: 0.1.0
Summary: AmpUp Harness Python SDK, including an Agno-compatible API (ampup_harness.agno)
Author: AmpUp
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agents,agno,ampup,harness,llm
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# ampup-harness

Python SDK for AmpUp Harness. Python 3.10+, standard library only (no dependencies).

```sh
uv add ampup-harness
```

Point it at a harness with environment variables:

```sh
export AMPUP_HARNESS_URL=https://harness.example.com
export AMPUP_HARNESS_API_KEY=...
# optional: send every model as an OpenRouter slug (for runtimes with only an OpenRouter key)
export AMPUP_HARNESS_AGNO_ROUTE=openrouter
```

## Agno-compatible API (`ampup_harness.agno`)

Code written for [Agno](https://github.com/agno-agi/agno) runs on the harness after changing
`from agno.` to `from ampup_harness.agno.` in its imports:

```python
from ampup_harness.agno.agent import Agent
from ampup_harness.agno.models.openai import OpenAIChat

agent = Agent(model=OpenAIChat(id="gpt-5"), instructions="Be terse.", markdown=True)
agent.print_response("Share a two-line story.", stream=True)
```

- **Agents without Python tools** become harness agent templates and run server-side; sessions,
  memory blocks and harness tools (`tools=["calculator"]`) live on the harness.
- **Agents with Python function tools** (functions, `@tool`, `Toolkit`, `Function`) run Agno's
  tool loop in your process over the harness gateway (`/v1/messages`); async tools run on the
  caller's event loop under `arun`.
- `run` / `arun` / `print_response`, streaming events, `Message`-list input, `cancel_run`,
  `agno.exceptions` and sequential `Workflow`s follow Agno 3.x. A provider failure ends a run the
  way Agno does: a `RunErrorEvent` in a stream, or `RunOutput.status == ERROR`.

Not covered yet: `Team`, knowledge bases (RAG), structured outputs, media inputs, reasoning
models, human-in-the-loop tools, and pre/post hooks. Arguments the harness cannot honour raise
`NotImplementedError` (when ignoring them would change the result) or warn.

## Low-level client

```python
from ampup_harness import HarnessConfig, HarnessError

config = HarnessConfig.from_env()  # AMPUP_HARNESS_URL, AMPUP_HARNESS_API_KEY
```

Use HTTPS beyond trusted loopback. Credentials stay in headers, redirects are refused, and URLs
carrying credentials, a query or a fragment are rejected.

License: Apache-2.0.
