feat(vision): ModelRouterVisionProvider + multimodal ChatMessage — bump nullain-sdk to 0.7.0 - #82
Merged
Merged
Conversation
…bump nullain-sdk to 0.7.0 VisionProvider (nullain.ports.vision) gains its first adapter, ModelRouterVisionProvider: routes an image + prompt through an injected ModelRouter/LLMProvider as a plain multimodal chat completion. PLAN.md Fase 2 rescoped for this — the vision path actually used in production needs no heavy OCR/CV dependency, so it ships as a module here instead of the separate nullain-vision package originally planned. ChatMessage.content (nullain.llm.types) now also accepts a list of TextPart/ImagePart content blocks (new ContentPart union). The existing str | None path is unchanged — to_api_dict() emits the exact same payload as before for every text-only message. VisionError added to the error hierarchy, mirroring SearchError's shape. test_vision_provider_contract.py now runs against ModelRouterVisionProvider via an offline fake LLMProvider. Version: nullain-sdk 0.6.0 -> 0.7.0 (MINOR). Per docs/api-stability.md, none of ChatMessage/VisionProvider/ModelRouterVisionProvider/SearchProvider are in nullain/__init__.py's __all__, so this technically wouldn't require any bump under the formal policy — but the change is additive and non-breaking regardless (str | list[ContentPart] | None is a superset of str | None; to_api_dict() is byte-for-byte unchanged for existing str | None callers), which is exactly a MINOR bump in practice. CHANGELOG's [Unreleased] block (search + vision work) moved to a dated [0.7.0] section. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Aug 12, 2026
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.
Summary
VisionProvider(nullain.ports.vision) gains its first adapter,ModelRouterVisionProvider: routes an image + prompt through an injectedModelRouter/LLMProvideras a plain multimodal chat completion (PLAN.md Fase 2, rescoped — no heavy OCR/CV package needed).ChatMessage.content(nullain.llm.types) now also acceptslist[TextPart | ImagePart](newContentPartunion). Existingstr | Nonepath is byte-for-byte unchanged into_api_dict().VisionErroradded to the error hierarchy, mirroringSearchError.nullain-sdk0.6.0 → 0.7.0 (MINOR). NeitherChatMessagenorVisionProvider/ModelRouterVisionProvider/SearchProviderare innullain/__init__.py::__all__(not covered by the formal SemVer policy perdocs/api-stability.md), but the change is additive/non-breaking regardless — exactly a MINOR case in practice.CHANGELOG.md's[Unreleased]block (search + vision work) moved to a dated[0.7.0]section.Test plan
make check(ruff + pyright strict + pytest) green — 726 passed, 7 skippedtest_vision_provider_contract.pyruns againstModelRouterVisionProvidervia an offline fakeLLMProvidernullain-sdk/src/nullain/__init__.py— zero lines changedNotes
v*tag, incompatible with the same) as separate tech-debt issues; not fixed in this PR.workflow_dispatchruns stuck inwaitingfor 1-3+ days.🤖 Generated with Claude Code