AI Role 树 — 约束 LLM 防致幻(Role / Policy 唯一源码)
Project description
airoles
Model-Agnostic Agent Role Framework — 防致幻规则 + PromptBuilder + Runtime。
pip install airoles
export AIROLES_API_KEY=sk-...
export AIROLES_BASE_URL=https://api.deepseek.com/v1
export AIROLES_MODEL=deepseek-chat
from airoles import Planner
result = Planner.from_env().run(
"帮我规划一套 ERP 系统",
policy_mode="planning",
)
print(result["need_confirmation"], result["plan"]["summary"])
无 API Key 测试(Mock Provider):
from airoles import Agent, CallableProvider
agent = Agent(CallableProvider(your_mock_fn))
out = agent.plan("...", skip_clarify=True)
三层
| 层 | API | 版本 |
|---|---|---|
| Prompt | ROLE_*, POLICY_*, templates |
v0.1+ |
| 组装 | PromptBuilder + PolicySelector + compiled/ |
v0.5 |
| Runtime | Planner.from_env().run() + Provider + Adapters |
v0.3+ |
- ARCHITECTURE.md — 六层架构 + P4 路线图
- OPERATION.md — 发版
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
airoles-0.5.7.tar.gz
(56.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
airoles-0.5.7-py3-none-any.whl
(102.1 kB
view details)
File details
Details for the file airoles-0.5.7.tar.gz.
File metadata
- Download URL: airoles-0.5.7.tar.gz
- Upload date:
- Size: 56.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14cda1872d2e72d26399a72b16d18fc846d70504fec60288c821fa2119614f50
|
|
| MD5 |
91cec727014c10ba115d3c0b73a9198a
|
|
| BLAKE2b-256 |
27d09941630edcdfd2e946cd0a251ac7c7a79b29da67db07e7ecb29cbb931778
|
File details
Details for the file airoles-0.5.7-py3-none-any.whl.
File metadata
- Download URL: airoles-0.5.7-py3-none-any.whl
- Upload date:
- Size: 102.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c97012b02a2c2625f35d01b93c09bc1691fff56058b293b567a19f6e6ee68ee4
|
|
| MD5 |
6c5f9999d3a0b6ca0bbd8f8131b8f91e
|
|
| BLAKE2b-256 |
1694e3bba23bdcd5e8379df00397cf02ff401f2c8c79d7501695a060ae127d2d
|