Repository navigation
fix(discovery): read input modalities from the architecture object - #86
Merged
Merged
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
jigjigjig
commented
Nov 20, 2026
jigjigjig
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed the diff and tested it against the live gateway. Nothing to change.
Code
- One-line change in
parseStandardEntry:architecture.input_modalitiesis read after the top-levelinput_modalitiesand beforemodality, so existing behaviour is untouched for any response that already worked. record()guards the nested read, so a string, null or arrayarchitectureis ignored instead of throwing. Covered by the newit.each.- The text-only default in
toProviderModelis unchanged when nothing is declared. omp/imports this parser, so it picks the fix up with no change of its own.
Checked against the live model list (GET https://api.otari.ai/api/v1/models, 349 models)
main: 0 models register image input.- This branch: 180 register image input.
deepseek/deepseek-v4.1-flash-1017maps to["text", "image"]. - Reasoning count is the same on both (109), so nothing else moved.
Checked the capability is real
- Sent a solid red PNG to
deepseek/deepseek-v4.1-flash-1017throughchat/completionsas animage_urlpart. It answered "Red".
Not tested
- The patched extension running inside Pi with a real image attachment.
CI (Validate package) is green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was trying to have images capabilities in deepseek and kept failing
Refs #6
What was wrong
parseStandardEntryonly read a top-levelinput_modalities(ormodality). The authenticatedGET /v1/modelsresponse nests the field underarchitecture, so every model fell back to["text"]and Pi stripped images ("Current model does not support images") even for vision-capable models.Real entry shape (trimmed):
{ "id": "deepseek/deepseek-v4.1-flash-1017", "object": "model", "type": "chat", "architecture": { "input_modalities": ["text", "image"], "output_modalities": ["text"] }, "supported_parameters": ["tools", "tool_choice", "response_format", "reasoning"] }There is no top-level
input_modalitiesormodalitykey in that response.Fix
Read
architecture.input_modalitiestoo. Precedence: top-levelinput_modalities, thenarchitecture.input_modalities, thenmodality. Existing reads are unchanged. When nothing is declared, models stay text-only. Theomp/directory imports this parsing rather than duplicating it, so it needs no change.Testing
New cases in
test/model-mapper.test.ts: nested image and text-only, top-level wins overarchitecture, no info defaults to text-only viatoProviderModel, and a malformedarchitecture(string, null, array) does not throw.npm run checkpasses (format, lint, typecheck, 262 tests). The live API was not called.Issue #6 is broader than this, so it stays open.