Metadata-Version: 2.4
Name: autogen-verdo
Version: 0.1.0
Summary: AutoGen tools for Verdo: structured team decisions with deadlines, routing and webhooks
Author: Verdo
License-Expression: MIT
Project-URL: Homepage, https://verdo.ink
Project-URL: Documentation, https://verdo.ink/agents
Keywords: autogen,autogen-extension,verdo,decisions,approvals,human-in-the-loop,agents
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: autogen-core>=0.4.0
Requires-Dist: httpx>=0.25.0
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"
Requires-Dist: pytest-asyncio>=0.23; extra == "test"
Requires-Dist: respx>=0.21; extra == "test"
Dynamic: license-file

# autogen-verdo

[AutoGen](https://github.com/microsoft/autogen) tools for [Verdo](https://verdo.ink): structured team decisions with deadlines, routing and webhooks.

Use it when your agent needs a person to approve, pick or sign off on something, and needs a structured result rather than a discussion. **The agent proposes; a person decides.** No tool invites people, approves, rejects or settles a decision.

## Install

```bash
pip install autogen-verdo
```

Needs Python 3.10+ and `autogen-core` 0.4 or newer.

## Set up

Create a **full-access** API key in Verdo (Settings > API keys). It starts with `vdok_`.

```bash
export VERDO_API_KEY=vdok_...
```

Or pass `api_key=` to `VerdoTools`.

## Use

```python
from autogen_agentchat.agents import AssistantAgent
from autogen_verdo import VerdoTools

agent = AssistantAgent(
    "planner",
    model_client=model_client,          # any autogen-ext chat completion client
    tools=VerdoTools().get_tools(),
    system_message="When a decision needs the team, propose it in Verdo and share the link.",
)
```

Or call a tool directly, since they're plain async methods:

```python
tools = VerdoTools()
created = await tools.create_decision(
    "Ship the redesigned onboarding this sprint?",
    ["Ship it", "One more round of testing", "Descope"],
    tags=["engineering"],                 # a routing rule on this tag assigns its approver
    idempotency_key="onboarding-sprint-47",
    source_agent="sprint-planner",
)
print(created["url"])                     # send this to the person who decides

status = await tools.check_decision(created["id"])
print(status["status"], status["outcome"])
```

## Tools

| Tool | What it does |
|---|---|
| `verdo_create_decision` | Proposes a decision. It invites nobody: the decision opens in the Verdo dashboard, and tags can route it to an approver configured in Verdo. With an `idempotency_key`, a retry returns the same open decision (`created: false`). |
| `verdo_check_decision` | Status, outcome once decided, votes per option, owner, link, `request_fingerprint`. |
| `verdo_list_decisions` | Up to 25 decisions, filtered by title words, status, tags, `source_agent` or notification status. |
| `verdo_search_decisions` | Past decided decisions by title words, newest first. |
| `verdo_get_precedent` | One past decision's record, with related decisions. |
| `verdo_cancel_decision` | Withdraws a draft or open decision this key created. |
| `verdo_edit_decision` | Revises a draft or open decision this key created. A change voids the votes cast so far. |

Past decisions come back with `execution_authorized: false`: they're records, not consent to repeat them. A failed call raises `VerdoAPIError` with a sentence the agent can act on.

## Webhooks

Instead of polling, subscribe a public https URL to an event (`decision.settled`, `decision.rejected`, `decision.cancelled`, `decision.expired`, `decision.escalated`) with `POST https://verdo.ink/api/v1/webhooks/subscribe`. The full API is at [verdo.ink/openapi.yaml](https://verdo.ink/openapi.yaml).

## Development

```bash
pip install -e ".[test]"
pytest tests/
```

## License

MIT
