Skip to content

fix(llm-pi-ai): accept inputModalities as alias for per-model input - #679

Open
sy121718 wants to merge 1 commit into
anywhere-labs:masterfrom
sy121718:master
Open

fix(llm-pi-ai): accept inputModalities as alias for per-model input#679
sy121718 wants to merge 1 commit into
anywhere-labs:masterfrom
sy121718:master

Conversation

@sy121718

Copy link
Copy Markdown

为什么

桌面端模型目录(配合 dsh-host-apiproxy-model-modalities 补丁)对外输出的字段名是 inputModalities,但 dsh-llm-pi-ai 解析 per-model 配置时只读 input

于是用户在 settings 里声明 inputModalities: [text, image] 会被静默忽略,
回落为默认的 ["text"],发送图片时触发:

MODEL_DOES_NOT_SUPPORT_IMAGES
当前模型不支持图片,请切换支持图片的模型

改了什么

  • schema: input 改为 .default([]),新增同类型的 inputModalities 字段作为别名
  • 消费链:改为
    entry.input ?? entry.inputModalities ?? base.input ?? base.inputModalities ?? defaultInput
  • 注册 @deepseek-ai/dsh-llm-pi-ai@0.1.1-rc.2 的 yarn patch resolution

优先级保持:原生 input > 别名 inputModalities > 目录 base.input > 目录别名 > 路由默认。

验证

resolveProfiles() 直接驱动真实管线做了冒烟测试:

用例 配置 结果
A 只写 inputModalities: [text,image] input == ["text","image"]
B 两个都不写 input == ["text"](回落默认) ✅
C inputinputModalities 同时写 原生 input 优先 ✅

node --check 语法校验通过。

The model-catalog layer advertises per-model input modalities under the
key `inputModalities` (see dsh-host-apiproxy-model-modalities patch),
but dsh-llm-pi-ai only reads `input`. A profile declaring vision via
`inputModalities` is therefore silently ignored, the route falls back
to the default text-only modality set, and image attachments are
rejected at send time with MODEL_DOES_NOT_SUPPORT_IMAGES.

- schema: declare optional `inputModalities` array alongside `input`
  (now defaulted to [] so absent arrays defer to catalog/route defaults)
- consumer chain: entry.input ?? entry.inputModalities ??
  base.input ?? base.inputModalities ?? request.defaultInput,
  preserving native-field precedence and existing fallback order
- register yarn patch resolutions for @deepseek-ai/dsh-llm-pi-ai@0.1.1-rc.2

Verified with node --check plus a runtime smoke test driving
resolveProfiles() directly:
  - inputModalities-only -> ["text","image"] (alias absorbed)
  - omitted              -> ["text"]        (defaultInput fallback intact)
  - both present         -> native `input` wins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant