Metadata-Version: 2.4
Name: airoles
Version: 0.5.8
Summary: AI Constitution layer — model-agnostic Role/Policy, audit, and CRUD disclosure for any executor
License-Expression: MIT
Project-URL: Homepage, https://gitee.com/wangguoran/airoles
Project-URL: Repository, https://gitee.com/wangguoran/airoles.git
Keywords: ai,llm,prompt,constitution,governance,anti-hallucination,agent,rag
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Provides-Extra: openai
Requires-Dist: openai>=1.0; extra == "openai"
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.25; extra == "anthropic"
Provides-Extra: mcp
Requires-Dist: mcp>=1.6.0; extra == "mcp"
Provides-Extra: kafka
Requires-Dist: kafka-python>=2.0; extra == "kafka"

# airoles

**AI 宪法树 · 按需走枝** — 每步只加载该环节的 Policy 枝条；司法在本包，执法在集成方。

```bash
pip install airoles
export AIROLES_API_KEY=sk-...
export AIROLES_BASE_URL=https://api.deepseek.com/v1
export AIROLES_MODEL=deepseek-chat
```

```python
from airoles import ConstitutionClient

client = ConstitutionClient.from_env()
result = client.plan("分析销售数据并给出可执行方案")
print(result.client_crud_notice)
if not result.audit.ok:
    print(result.audit.violations)
```

无 API Key 仅审计划：`airoles-audit path/to/plan.json`

**完整说明见 [DOCS.md](./DOCS.md)**（安装、宪法树、架构、MCP、审计、测试、发版）。

```text
任意模型 → airoles（宪法 + 司法）→ 你的实践层（执法）
```
