dsh-send-photos
Manifest validDeclares image input on relay routes whose endpoint omits modality metadata, so models that can see photos stop being rejected as text-only. This also overrides routes that are explicitly declared tex
dsh-send-photos
English: README.en.md
让 DSH 接受本会被拒收的图片,用在那些收得下图、却没有声明多模态能力的中转站/反代上。
问题
DSH 判断一个模型能不能收图,只读 llm-pi-ai 解析出来的模型元数据。中转站的 /v1/models 通常不返回模态信息,配置里于是没有 input,落到默认值 ["text"]。图片在到达上游之前就被本地两道闸门拦掉:
| 层 | 位置 | 表现 |
|---|---|---|
| 会话准入 | dsh-api-session-controller prompt() | session/attachment-invalid,reason MODEL_DOES_NOT_SUPPORT_IMAGES |
| 请求适配 | dsh-llm-pi-ai streamWithSnapshot() | LlmError UNSUPPORTED_CONTENT |
所以模型明明认得图,DSH 却在你按下发送时就拒绝。
做法
两道闸门读的是同一个值:adapter 的 modelOf() 解析出的模型对象。插件只在这个方法外面套一层,对管辖范围内的路由,把缺失的 image 补进 input。
- 不写配置:不碰
cordis.patch.yml,不碰 settings 文档,不动 profile。 - 不改请求:图片仍以标准 OpenAI image part 发出,没有编码、拆分或伪装。
- 可逆:插件卸载时把
modelOf原样还原。 - 只作用于存在
modelOf的适配器(pi-ai 路由)。官方 DeepSeek 账号路由走另一个适配器,不受影响。 - 监听
llm/adapters-updated,后挂载的路由、后新增的模型同样被覆盖。
安装
这是一个 DSH bundle 包(dsh.bundle.patch),不是普通 npm 脚本。
# 桌面版:在插件管理器里以本地目录安装,或
dsh plugin --profile <你的 profile> add link:<本目录绝对路径>
安装后 profile 的 package.json 会增加一条依赖,Loader 里多一行 dsh-send-photos。
卸载:在插件管理器中移除该 bundle(plugin_manager 的 remove_bundle),或
dsh plugin --profile <你的 profile> remove dsh-send-photos
配置
- id: dsh-send-photos
name: dsh-send-photos
config:
providers: [] # 要覆盖的 route;空数组 = 全部已挂载路由
modalities: [text, image]
enabled: true
只作用于某个中转站:
providers:
- my-relay
注意
- 这是补声明,不是让上游变强。某个模型上游确实不收图时,请求会在上游失败;把该 route 从
providers里排除即可。 - 显式写了
["text"]的模型也会被覆盖(解析后无法区分“声明为纯文本”和“没声明”)。如果某个 route 上有这类模型,用providers缩小范围,或只保留需要的那条。 - 依赖
llm-pi-ai路由(api: openai-completions这类)。若将来 DSH 改了适配器内部方法名,插件会打一条 warn 并保持无害的空转。 - 在 DSH
0.2.1-rc.2上验证通过。
License
MIT
Comments
Loading…
Similar plugins
by GooDAnDReaDY
Routes images to a vision model of your choice - auto-rewrite, explicit tools, or hybrid - so a text-only chat model does not fail a turn that contains a picture.
★ 2
↓ 593/wk
MIT
JavaScript
Sep 26, 2026
dsh plugin --profile web add @goodandready/dsh-vision-bridgeTransparent multimodal routing for text-only models: every image in every model call is fully transcribed (verbatim OCR, data, uncertainty zones, injection-hardened) by your own multimodal understande
★ 0
dsh plugin --profile web add dsh-mmrouteby ct-jyjntc
Declare whether a configured third-party model accepts image (multimodal) input; writes the modality into the owning provider settings and verifies it through runtime model resolution.
★ 0
MIT
JavaScript
Sep 7, 2026
dsh plugin --profile web add dsh-model-modalityby Junkrat9527
Vision for text-only dsh models: paste an image and a configured multimodal model transcribes it to text automatically — transparent twin routing, an agent-callable read-image tool, no built-in keys o
★ 0
↓ 45/wk
MIT
JavaScript
Aug 18, 2026
dsh plugin --profile web add @iroam2375/dsh-autovisionLocal OCR fallback for text-only routes: when the session model declares it cannot accept images, the attached image is cached locally and its path injected so the model can call ocr_image — PP-OCRv5
★ 0
dsh plugin --profile web add dsh-ocr-localText-to-image and image-to-image for a model that cannot draw, through any OpenAI-compatible image API, with multiple providers and an automatic fallback model.
★ 0
dsh plugin --profile web add kkj-luna-dsh-image-bridge