Passer au contenu principal
R

dsh-prompt-engineering

rose-1-4/dsh-prompt-engineering

One-click prompt optimizer button in the composer: rewrites the current draft with a six-step pipeline and previews the result before replacing it.

Installer

dsh plugin --profile web add github:rose-1-4/dsh-prompt-engineering

README

dsh-prompt-engineering-button

icon

DeepSeek Harness 插件:在输入框右侧提供「一键优化提示词」按钮。读取当前草稿,按六步流水线改写,结果先进入预览框,确认后再替换草稿——不会自动发送,也不直接写入对话。

功能

  • 读取输入框草稿(上限 8000 字符),调用宿主默认模型改写。
  • 结果进入输入框上方的预览卡,可直接编辑、复制或放弃。
  • 改写模式:自动选型、仅六段式结构、或指定 12 条推理框架之一。
  • 未确认的信息要求标注「未确认」,不编造。

安装

在宿主中安装插件(插件市场或本地安装),并在 profile 的 dsh.profile.bundles 中登记:

{ "dependencies": { "dsh-prompt-engineering-button": "file:./local-plugins/dsh-prompt-engineering-button" },
  "dsh": { "profile": { "bundles": ["dsh-prompt-engineering-button"] } } }

安装后刷新页面;涉及宿主侧改动时需完全退出并重开应用。

接口

POST /plugins/dsh-prompt-engineering-button/optimize

  • 请求:{ "text": "<草稿>", "mode": "auto" },mode 省略时按 auto 处理。
  • 成功:{ "ok": true, "prompt": "<改写结果>", "mode": "...", "provider": "...", "model": "..." }
  • 失败:{ "ok": false, "error": "<原因>" };405 非 POST、400 空草稿或坏 JSON、413 超长、503 无可用模型、502 模型调用失败。

依赖

宿主需提供 webServer 与 llm 服务;模型路由取 agentDefaultModel.currentSelection()。任一缺失只影响本按钮,不影响会话其他功能。

许可

MIT License,见 LICENSE。

Plugins associés