Metadata-Version: 2.4
Name: algovoi-plugin-autogen
Version: 0.1.0
Summary: AlgoVoi payment guardrail capability and tools for AutoGen / ag2
License: Apache-2.0
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27
Requires-Dist: rfc8785>=0.1.4
Provides-Extra: autogen
Requires-Dist: pyautogen>=0.2; extra == "autogen"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: respx>=0.21; extra == "dev"

# algovoi-plugin-autogen

AlgoVoi payment guardrail capability and payment function for [AutoGen / ag2](https://github.com/ag2ai/ag2).

## Installation

```bash
pip install algovoi-plugin-autogen[autogen]
```

## Components

### AlgoVoiGuardrailCapability

A callable that can be registered as a before-tool hook in ag2. Screens the
`recipient_address` in any tool's input against AlgoVoi compliance/screen and
returns `{allow: bool, reason: str, verdict: str}`.

```python
from algovoi_plugin_autogen import AlgoVoiGuardrailCapability

guardrail = AlgoVoiGuardrailCapability(api_key="algv_...", fail_open=True)
agent.register_hook("tool_call_before", guardrail)
```

### AlgoVoiPaymentFunction

Function-style payment tool with a JSON schema for ag2 function-calling.

```python
from algovoi_plugin_autogen import AlgoVoiPaymentFunction

pay_fn = AlgoVoiPaymentFunction(api_key="algv_...")
agent.register_function(function_map={"algovoi_pay": pay_fn})
```

## License

Apache-2.0
