Metadata-Version: 2.4
Name: viktron-sdk
Version: 0.2.0
Summary: Framework-agnostic governance SDK for AI agents — policy enforcement, telemetry, and observability
Author-email: Viktron AI <support@viktron.ai>
License-Expression: Apache-2.0
Project-URL: Homepage, https://viktron.ai
Project-URL: Documentation, https://viktron.ai/docs
Project-URL: Repository, https://github.com/vikasvardhanv/viktron-agentsALR
Keywords: ai,agents,governance,telemetry,observability,llm
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.24.0
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.1.0; extra == "langchain"
Provides-Extra: crewai
Requires-Dist: crewai>=0.1.0; extra == "crewai"
Provides-Extra: autogen
Requires-Dist: pyautogen>=0.2.0; extra == "autogen"
Provides-Extra: all
Requires-Dist: langchain-core>=0.1.0; extra == "all"
Requires-Dist: crewai>=0.1.0; extra == "all"
Requires-Dist: pyautogen>=0.2.0; extra == "all"

# Viktron SDK

Framework-agnostic governance SDK for AI agents — policy enforcement, telemetry, and real-time observability for production AI systems.

## Install

```bash
pip install viktron-sdk
```

## Quick Start

### Telemetry (send agent events to your Viktron dashboard)

```python
from viktron_sdk import ViktronTelemetry

tel = ViktronTelemetry(api_key="vk_live_...", agent_slug="my-agent")

# Record a task
tel.record_task("task-123", status="completed", duration_ms=4200, cost_usd=0.003)

# Use a context-managed span
with tel.span("run_campaign") as span:
    span.set_attribute("platform", "meta")
    result = run_campaign()
    span.set_output(result)

tel.close()  # flush remaining events
```

### Policy Guard (intercept LLM calls with governance rules)

```python
import openai
from viktron_sdk import ViktronGuard

client = ViktronGuard.wrap(
    openai.OpenAI(),
    api_key="vk_live_...",
    agent_id="sales-agent-prod",
)

# All create() calls are now policy-checked
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello"}],
)
```

Works with OpenAI (sync & async), Anthropic, Cohere, and any client with `.create()` / `.generate()` call patterns.

### Framework Integrations

```python
# LangChain
from viktron_sdk.integrations.langchain import ViktronCallbackHandler
handler = ViktronCallbackHandler(api_key="vk_live_...", agent_id="my-chain")

# CrewAI
from viktron_sdk.integrations.crewai import ViktronCrewAIObserver
observer = ViktronCrewAIObserver(api_key="vk_live_...", agent_id="my-crew")

# AutoGen
from viktron_sdk.integrations.autogen import ViktronAutoGenHook
hook = ViktronAutoGenHook(api_key="vk_live_...", agent_id="my-autogen")
```

## API Keys

Generate your API key at [app.viktron.ai](https://app.viktron.ai) → Settings → API Keys.

Keys prefixed `vk_live_` are production; `vk_test_` are for testing.

## Links

- [Dashboard](https://app.viktron.ai)
- [Documentation](https://viktron.ai/docs)
- [GitHub](https://github.com/vikasvardhanv/viktron-agentsALR)
