dsh-vision-autoswitch
模型与 MCP 活跃维护

dsh-vision-autoswitch

CultOfLuna/dsh-vision-autoswitch

自动识别输入内容是否含图片,无需手动点击即可在DeepSeek Vision与Pro/Flash模型间自动切换,省去反复调整模型的繁琐,使用体验更流畅。

1
Stars 标星
0
Forks 分支
1
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
11 KB
仓库大小
3 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:CultOfLuna/dsh-vision-autoswitch
git clone https://github.com/CultOfLuna/dsh-vision-autoswitch.git
git clone git@github.com:CultOfLuna/dsh-vision-autoswitch.git
README.md main

dsh-vision-autoswitch

DeepSeek 的"自动挡":有图切 Vision,无图回 Pro/Flash,一键都不用点。

DeepSeek's "automatic transmission": image in → Vision, image out → back to Pro/Flash — not a single click.

DeepSeek Harness 插件:当输入包含图片时,临时把当前回合切换到视觉模型
deepseek-v4-flash-vision-exp 处理;该回合结束后自动回落到你原来的模型。
模型栏所见即所得(visibleSwitch 默认开启),当前实际模型与 UI 显示始终一致。

A DeepSeek Harness plugin: when a request carries an image, route that turn to
the vision model deepseek-v4-flash-vision-exp, then automatically fall back
to your original model when the turn ends. The model bar always reflects the
actual model in use (WYSIWYG).

功能 / Features

  • 图片 → 视觉模型:当前回合出现图片(用户附件或工具结果里的截图)即切到
    deepseek-v4-flash-vision-exp,让图片真正被理解。
  • 回合结束即回落:turn/end 后立即回到你原选的模型,不依赖下一条输入再检测;
    长对话也不失灵。
  • 所见即所得:模型栏同步显示切换与回落;实际分发模型与 UI 一致,不会卡在视觉模型。
  • 无需改模型选择:不写入你原本的模型选择,纯文本回合仍由你选的高能力模型承担。
  • 回落目标跟随你的选择:回落回到你当前手动选择的模型(不写死某个模型)。

工作原理 / How it works

  1. 在 agent/request 阶段检测当前回合是否含图(contentHasImage),含图则把
    provider/model 改写为视觉模型;
  2. 按会话记住最近一次「非视觉模型」作为回落目标(避免被视觉请求头污染);
  3. 监听 turn/end,回合结束后写入 model/selection 恢复原模型。

安装 / Install

把插件装入 profile 的 node_modules,并在该 profile 的 cordis.patch.yml
追加:

- insert:
    - id: vision-autoswitch
      name: 'dsh-vision-autoswitch'

profile 默认 patchReload: live,保存后约 1 秒热重载;改插件代码需重启 DSH Desktop。

配置 / Config

字段 默认值 说明
enabled true 总开关
visionProvider deepseek-official 视觉模型所属 provider
visionModel deepseek-v4-flash-vision-exp 视觉模型
providers ["deepseek-official"] 允许拦截的 provider
visibleSwitch true 模型栏跟随切换/回落(所见即所得)

License

MIT