math-router

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Math 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
undefined
bash
undefined

Route any math intent to get the CLI command

将任意数学意图路由以获取CLI命令

uv run python scripts/cc_math/math_router.py route "<user's math request>"
undefined
uv run python scripts/cc_math/math_router.py route "<用户的数学请求>"
undefined

Example Workflow

示例流程

  1. User says: "integrate sin(x) from 0 to pi"
  2. You run:
    uv run python scripts/cc_math/math_router.py route "integrate sin(x) from 0 to pi"
  3. 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
    }
  4. You execute the returned command
  5. Return result to user
  1. 用户输入:"计算sin(x)从0到pi的积分"
  2. 运行命令:
    uv run python scripts/cc_math/math_router.py route "integrate sin(x) from 0 to pi"
  3. 路由工具返回:
    json
    {
      "command": "uv run python scripts/cc_math/sympy_compute.py integrate \"sin(x)\" --var x --lower 0 --upper pi",
      "confidence": 0.95
    }
  4. 执行返回的命令
  5. 将结果返回给用户

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

可用路由

CategoryCommands
sympyintegrate, diff, solve, simplify, limit, det, eigenvalues, inv, expand, factor, series, laplace, fourier
pintconvert, check
shapelycreate, measure, pred, op
z3prove, sat, optimize
scratchpadverify, explain
tutorhint, steps, generate
plotplot2d, plot3d, latex
分类命令
sympyintegrate, diff, solve, simplify, limit, det, eigenvalues, inv, expand, factor, series, laplace, fourier
pintconvert, check
shapelycreate, measure, pred, op
z3prove, sat, optimize
scratchpadverify, explain
tutorhint, steps, generate
plotplot2d, plot3d, latex

List All Commands

列出所有命令

bash
undefined
bash
undefined

List 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
undefined
uv run python scripts/cc_math/math_router.py list --category sympy
undefined

Fallback

降级方案

If the router returns
{"command": null}
, the intent wasn't recognized. Then:
  1. Ask user to clarify
  2. Or use individual skills: /sympy-compute, /z3-solve, /pint-compute, etc.
如果路由工具返回
{"command": null}
,则表示意图未被识别。此时:
  1. 请求用户澄清需求
  2. 或使用单个技能:/sympy-compute, /z3-solve, /pint-compute等。