Moshe-ship/mtg
GitHub: Moshe-ship/mtg
MTG是一个用于多语言工具调用参数的JSON Schema扩展,旨在提高多语言应用的可靠性。
Stars: 0 | Forks: 0
# mtg — 形态类型守卫
**多语言工具调用参数的 JSON Schema 扩展。**
[](https://pypi.org/project/mtg-guards/)
[](https://github.com/Moshe-ship/mtg/actions/workflows/ci.yml)
[](LICENSE)
[](#status)
[](https://python.org)
## 状态
## 安装
## 快速入门
## 架构
## `x-mtg` 扩展
```
{
"type": "string",
"x-mtg": {
"slot_type": "inflected_request_form",
"script": "ar",
"dialect_expected": "gulf",
"dialect_enforcement": "preserve",
"transliteration_allowed": false,
"morphologically_productive": true,
"canonicalization": "root_pattern",
"mode": "advisory",
"post_call_contract": ["script_match", "dialect_preserve"]
}
}
```
## 违规分类学
## 命令行界面 (CLI)
## 程序性评估 (`mtg.eval`)
```
from pathlib import Path
from mtg import GuardSpec
from mtg.eval import run_on_jsonl, ALL_ARMS
guard_map = {
"intent_phrase": GuardSpec.from_dict({
"slot_type": "inflected_request_form",
"script": "ar",
"dialect_expected": "gulf",
"morphologically_productive": True,
"mode": "advisory",
}),
}
report = run_on_jsonl(Path("datasets/mtg_slots_v1.jsonl"), guard_map)
print(report.violation_counts) # Counter({'DIALECT_DRIFT': 3, ...})
print(report.dialect_violation_rates) # {'gulf': 0.0, 'egy': 0.33, ...}
# 研究项目实验臂(spec/resolution.md)
for arm in ALL_ARMS:
print(arm.name, arm.description)
```
## 限制(v0.1.0)
## 相关项目
- [arabic-agent-eval](https://github.com/Moshe-ship/arabic-agent-eval) — 51 项阿拉伯语功能调用基准,具有方言划分。MTG 的主要诊断基础。
- [ToolProof](https://github.com/Moshe-ship/toolproof) — 代理工具调用验证。MTG 违规通过 `toolproof.mtg_bridge.from_mtg_violation` 转换为 ToolProof 收据。
- [artok](https://github.com/Moshe-ship/artok) — 涵盖 18 个标记化器的阿拉伯语标记成本计算器。为 MTG 压缩声明提供未来工作的基础。
- [NousResearch/Hermes-Function-Calling](https://github.com/NousResearch/Hermes-Function-Calling) — 目标适配器上游着陆点。
- [NousResearch/atropos](https://github.com/NousResearch/atropos) — MTG-guarded RL 执行的社区环境。
## 引用
```
@software{mtg_2026,
title = {Morphological Type Guards: A JSON Schema extension for multilingual tool-call arguments},
author = {Abumazin, Mousa},
year = {2026},
url = {https://github.com/Moshe-ship/mtg}
}
```
## 许可证
Apache-2.0。见 [LICENSE](LICENSE)。
标签:Apache 2.0 许可, CLI 工具, JSON Schema 扩展, Python 库, UTS #39 槽门混淆检查, 双向/右到左安全, 多语言工具调用, 安全可观测性, 实验研究, 开源框架, 性能评估, 持续集成, 提示注入启发式, 数据集处理, 波斯语脚本检测, 版本控制, 程序化评估, 类型守卫, 跟踪评分, 软件架构, 逆向工具, 错误处理, 阿拉伯语脚本检测