Skip to content

feat(vision): add optional hint param to VisionProvider port (0.7.1) - #83

Merged
netty-linux merged 1 commit into
masterfrom
feat/vision-provider-hint
Aug 12, 2026
Merged

feat(vision): add optional hint param to VisionProvider port (0.7.1)#83
netty-linux merged 1 commit into
masterfrom
feat/vision-provider-hint

Conversation

@netty-linux

Copy link
Copy Markdown
Owner

Summary

  • VisionProvider.describe_image/ocr/analyze_screenshot gain an optional, keyword-only hint: str | None = None — free-text guidance to steer what an adapter prioritizes (e.g. the end user's own question about the image).
  • ModelRouterVisionProvider folds hint into its internal prompt when given; unchanged prompt when omitted. Not sanitized by the adapter — a caller feeding user-supplied text is responsible for sanitizing it first.
  • Bumped nullain-sdk 0.7.00.7.1. PATCH, not MINOR: purely additive, no existing call site affected, and VisionProvider isn't part of the top-level nullain.__all__ public surface (docs/api-stability.md).

Driven by nullain-agent's Fase 3 vision-port migration: the prior Groq-direct call passed the user's chat message as a hint to prioritize the image description, and the Protocol had no equivalent lever.

Test plan

  • ruff check . / ruff format --check . — clean
  • pyright — 0 errors
  • pytest tests/unit/test_vision_provider_contract.py tests/unit/test_chat_message_content_parts.py — 14/14 passed (2 new: hint used / hint omitted)
  • Full suite: 726 passed, 7 skipped, 2 pre-existing unrelated failures (test_tools_security.py, Windows sandbox echo PATH issue, reproduces identically on master)

Not publishing to PyPI from here — per repo convention, that's a manual workflow_dispatch with target=pypi after merge, gated by environment approval.

🤖 Generated with Claude Code

nullain-agent's Fase 3 vision-port migration needs a way to steer what
describe_image/ocr/analyze_screenshot prioritize (the user's own question
about the image) — the prior Groq-direct call passed this as a hint, and
the Protocol had no equivalent lever.

Adds hint: str | None = None, keyword-only, to all three VisionProvider
methods and threads it through ModelRouterVisionProvider's internal
prompt. Purely additive: no existing call site is affected, and
VisionProvider isn't part of the top-level nullain.__all__ public surface
(docs/api-stability.md) — 0.7.1, not a MINOR bump.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@netty-linux
netty-linux merged commit 6ac763f into master Aug 12, 2026
11 checks passed
@netty-linux
netty-linux deleted the feat/vision-provider-hint branch August 12, 2026 12:29
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