Metadata-Version: 2.4
Name: vantageai
Version: 0.2.1
Summary: Vendor-neutral governance SDK for enterprise AI agents
Author-email: Vantage <sdk@vantage.ai>
License: MIT
Project-URL: Homepage, https://vantage.ai
Project-URL: Repository, https://github.com/vantageai/vantage
Keywords: ai,agents,governance,audit,observability
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27.0
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3.0; extra == "langchain"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: respx>=0.21; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Dynamic: license-file

# vantageai — Python SDK

> **Vendor-neutral governance SDK for enterprise AI agents.**

## Install

```bash
pip install vantageai
```

## Quick Start

```python
import asyncio
from vantageai import VantageClient

async def main():
    client = VantageClient(api_key="your-api-key", agent_id="your-agent-id")

    # Log an event
    await client.log_event(type="llm_call", input={"model": "gpt-4o"})

    # Execution trace
    trace = await client.start_execution(session_id="session-123")
    await client.log_step(trace.id, step={
        "stepNumber": 1, "type": "tool_call", "toolName": "search"
    })
    await client.complete_execution(trace.id, status="complete")

    # Policy evaluation
    result = await client.evaluate(
        action_type="send_email",
        action_payload={"to": "user@example.com"},
    )
    if result.decision == "block":
        print("Action blocked:", result.reason)
    elif result.decision == "pending_approval":
        approval = await client.wait_for_approval(result.approval_request_id)
        print("Approved by:", approval.resolved_by)

    # Intent shift enforcement
    intent = await client.start_intent(declared_intent="Reconcile Q1 invoices")
    shift = await client.log_shift(
        intent.id,
        observed_intent="Approve duplicate payment of $28,000",
        severity="critical",
    )
    if shift.decision == "block":
        print("Blocked by policy")
    elif shift.decision == "pending_approval":
        approval = await client.wait_for_approval(shift.approval_request_id)
        print("Approved by:", approval.resolved_by)

asyncio.run(main())
```

## Sync Usage

```python
from vantageai import VantageClientSync

client = VantageClientSync(api_key="your-api-key", agent_id="your-agent-id")
client.log_event(type="llm_call")
```

## LangChain Integration

```python
from vantageai import VantageClient
from vantageai.integrations.langchain import VantageCallbackHandler

client = VantageClient(api_key="your-api-key", agent_id="your-agent-id")
handler = VantageCallbackHandler(client)

# Pass handler to any LangChain chain/agent
chain.invoke({"input": "..."}, config={"callbacks": [handler]})
```

## Admin & Settings APIs

```python
from vantageai import VantageClientSync

client = VantageClientSync(api_key="your-api-key", agent_id="your-agent-id")

# Webhooks
webhook = client.create_webhook(
    url="https://httpbin.org/post",
    events=["policy_blocked", "intent_shift"],
)
client.list_webhooks()
client.delete_webhook(webhook.id)

# Members + audit log
client.list_members()
client.get_audit_log()

# Retention
client.get_retention_policy()
client.update_retention_policy(events_retention_days=90, traces_retention_days=90)

# Billing
client.get_billing_subscription()
client.get_billing_usage()
client.create_billing_upgrade("pro")
client.create_billing_portal()
```
