xingling80/dsh-zhipu-vision ↗★ 1
dsh-zhipu-vision
Zhipu (智谱) GLM-4V vision understanding for DSH: agent tool zhipu_vision (local image path or URL + prompt) calls the Zhipu vision API and returns the model answer; paste-to-identify UX — pasting an image into the chat composer saves it on the host and inserts the recognition instruction into the composer through the official conversation input face, so you type your own question after it and send once; the text-only chat model (DeepSeek) answers via the tool. A sidebar 视觉 panel with image+question combo send (sessions driver, same as the task board), a saved-image gallery, and a plugin config card in the GUI settings. Hot-pluggable — mounted via the web profile cordis.patch.yml + a profile node_modules copy, no dsh source changes.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:xingling80/dsh-zhipu-vision说明文档
阅读完整 README ↗dsh-zhipu-vision — 视觉理解插件(DSH 原生插件)
基于官方 NPM SDK(dsh-tools / dsh-host-webserver / dsh-system-prompt / schemastery)实现的
DSH 原生插件,不修改 DSH 源码。核心体验:聊天框粘贴图片 → 自动识别 → DeepSeek 回答
(视觉识别由智谱 GLM-4V 负责,回答由 DeepSeek 负责,全程不切换模型)。
界面显示名统一为「视觉」:侧边栏入口、面板标题、设置卡片均显示「视觉」; 包名 / 工具名 / 路由仍为
dsh-zhipu-vision/zhipu_vision//api/dsh-zhipu-vision/*。
能力
| 能力 | 说明 |
|---|---|
| 粘贴识图(核心) | 聊天框 Ctrl+V 粘贴图片 → 自动保存到 ~/.dsh/pastes/ → 识别指令插入输入框(官方 conversation input 通道,立即可见)→ 你继续输入自己的需求 → 一次回车发送 → DeepSeek 调用 zhipu_vision 结合图片回答你的需求 |
| 视觉侧边栏 | 侧边栏「视觉」入口 → 面板:粘贴/拖图 + 缩略图 + 需求输入框 + 「发送给 DeepSeek」(图片+问题一条消息入会话)+ 面板内快速识别 + 已保存图片画廊 + 清空历史 |
| 视觉理解工具 | zhipu_vision:本地图片绝对路径 或 http(s) URL + 提问 → 返回模型回答(图片描述 / OCR / 截图分析 / 图表文档解读) |
| 设置入口 | GUI 设置 → 插件 → 插件配置 →「视觉」卡片:API Key(只写不回显)、模型、接口、超时、大小上限、粘贴拦截、自动发送、保留天数 |
| 图片保留 | 默认保留 7 天自动清理(keepPastesDays 可调,0 = 永久);面板可一键清空 |
| 零运行时依赖 | host 使用 Node ≥22 内置 fetch;浏览器端仅依赖 React |
粘贴识图怎么用(推荐)
- 复制任意图片(截图用 Win+Shift+S)
- 在聊天输入框 Ctrl+V
- 插件自动:保存图片,并在输入框插入「识别这张图片:」
- 在它后面输入你的需求(如:这个报错怎么解决?这段代码有什么问题?)
- 回车发送 → DeepSeek 调用
zhipu_vision看图并针对你的需求回答
另一条路:侧边栏「视觉」面板 → 粘贴图片 → 输入需求 → 「发送给 DeepSeek」,效果相同。 可关选项(设置卡片):
interceptPaste(不拦截粘贴)、autoSendOnPaste(开启后粘贴即自动发送纯识别消息,不等你输入需求)。
架构
浏览器(web GUI) host 进程
┌────────────────────────────┐ ┌──────────────────────────────────┐
│ 聊天框粘贴图片(拦截) │ base64 │ /api/dsh-zhipu-vision/paste │
│ ↓ 保存后自动发送 │ ─────► │ 保存到 ~/.dsh/pastes/,返回路径 │
│ sessions.driver.prompt │ │ │
│ 「识别这张图片:」入会话 │ ─────► │ 当前会话 agent(DeepSeek) │
│ ↓ │ │ 调用 zhipu_vision 工具 │
│ 聊天流显示识别回答 │ ◄───── │ ZhipuVisionEngine(GLM-4V 推理) │
│ 侧边栏面板:画廊/识别/清空 │ ─────► │ /pastes /paste-file /analyze │
│ 设置→插件→插件配置 卡片 │ ─────► │ /config │
└────────────────────────────┘ └──────────────────────────────────┘