math-router
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMath Router
数学路由工具(Math Router)
ALWAYS use this router first for math requests.
Instead of reading individual skill documentation, call the router to get the exact command:
处理数学请求时请始终优先使用此路由工具。
无需阅读单个技能文档,调用该路由工具即可获取精确命令:
Usage
使用方法
bash
undefinedbash
undefinedRoute any math intent to get the CLI command
将任意数学意图路由以获取CLI命令
uv run python scripts/cc_math/math_router.py route "<user's math request>"
undefineduv run python scripts/cc_math/math_router.py route "<用户的数学请求>"
undefinedExample Workflow
示例流程
- User says: "integrate sin(x) from 0 to pi"
- You run:
uv run python scripts/cc_math/math_router.py route "integrate sin(x) from 0 to pi" - Router returns:
json
{ "command": "uv run python scripts/cc_math/sympy_compute.py integrate \"sin(x)\" --var x --lower 0 --upper pi", "confidence": 0.95 } - You execute the returned command
- Return result to user
- 用户输入:"计算sin(x)从0到pi的积分"
- 运行命令:
uv run python scripts/cc_math/math_router.py route "integrate sin(x) from 0 to pi" - 路由工具返回:
json
{ "command": "uv run python scripts/cc_math/sympy_compute.py integrate \"sin(x)\" --var x --lower 0 --upper pi", "confidence": 0.95 } - 执行返回的命令
- 将结果返回给用户
Why Use The Router
为何使用该路由工具
- Faster: No need to read skill docs
- Deterministic: Pattern-based, not LLM inference
- Accurate: Extracts arguments correctly
- Complete: Covers 32 routes across 7 scripts
- 更高效:无需阅读技能文档
- 确定性:基于模式匹配,而非LLM推理
- 精准性:正确提取参数
- 全面性:覆盖7个脚本中的32条路由
Available Routes
可用路由
| Category | Commands |
|---|---|
| sympy | integrate, diff, solve, simplify, limit, det, eigenvalues, inv, expand, factor, series, laplace, fourier |
| pint | convert, check |
| shapely | create, measure, pred, op |
| z3 | prove, sat, optimize |
| scratchpad | verify, explain |
| tutor | hint, steps, generate |
| plot | plot2d, plot3d, latex |
| 分类 | 命令 |
|---|---|
| sympy | integrate, diff, solve, simplify, limit, det, eigenvalues, inv, expand, factor, series, laplace, fourier |
| pint | convert, check |
| shapely | create, measure, pred, op |
| z3 | prove, sat, optimize |
| scratchpad | verify, explain |
| tutor | hint, steps, generate |
| plot | plot2d, plot3d, latex |
List All Commands
列出所有命令
bash
undefinedbash
undefinedList all available routes
列出所有可用路由
uv run python scripts/cc_math/math_router.py list
uv run python scripts/cc_math/math_router.py list
List routes by category
按分类列出路由
uv run python scripts/cc_math/math_router.py list --category sympy
undefineduv run python scripts/cc_math/math_router.py list --category sympy
undefinedFallback
降级方案
If the router returns , the intent wasn't recognized. Then:
{"command": null}- Ask user to clarify
- Or use individual skills: /sympy-compute, /z3-solve, /pint-compute, etc.
如果路由工具返回,则表示意图未被识别。此时:
{"command": null}- 请求用户澄清需求
- 或使用单个技能:/sympy-compute, /z3-solve, /pint-compute等。