wszw142857-beep/dsh-tool-cards ↗★ 0

dsh-tool-cards

在回复中渲染可交互的表单、图表等卡片 适合需要通过滑块、表单等 UI 交互并将结果回传给智能体的场景。

包名
dsh-tool-cards
兼容性
待验证
版本
0.1.0
许可证
MIT
最近更新
2026年10月19日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:wszw142857-beep/dsh-tool-cards

Usage

The chat_ui tool appears in the model's tool set. Its description tells the model when to reach for it (parameter tuning, multi-dimensional comparison, "build me a calculator") and when not to (pure explanation, one-shot answers).

A minimal payload:

{
  "title": "药剂投加量计算器",
  "ui": {
    "schemaVersion": "chat-ui/1.0",
    "initialState": { "soilTons": 1000, "doseGPerKg": 2 },
    "tree": {
      "id": "root",
      "type": "Card",
      "props": { "title": "药剂投加量" },
      "children": [
        { "id": "soil", "type": "Input", "label": "土壤质量 (t)", "bind": "soilTons",
          "props": { "inputType": "number", "min": 0 } },
        { "id": "dose", "type": "Slider", "label": "投加量 (g/kg)", "bind": "doseGPerKg",
          "props": { "min": 0.1, "max": 5, "step": 0.1 } },
        { "id": "total", "type": "Metric", "label": "理论药剂质量", "props": { "unit": "t" },
          "value": { "op": "round", "args": [
            { "op": "div", "args": [
              { "op": "mul", "args": [{ "var": "soilTons" }, { "var": "doseGPerKg" }] }, 1000
            ] }, 3 ] } },
        { "id": "submit", "type": "Button", "label": "提交这次配比", "actionId": "apply" }
      ]
    },
    "actions": {
      "apply": {
        "kind": "submitToAgent",
        "operation": "apply-dose",
        "includeKeys": ["soilTons", "doseGPerKg"]
      }
    }
  }
}

Action kinds: submitToAgent, callTool, openUrl (http/https only).