Skip to content

feat: support Anthropic Messages vision requests - #22

Merged
Anionex merged 4 commits into
mainfrom
feat/anthropic-vision-client
Aug 14, 2026
Merged

feat: support Anthropic Messages vision requests#22
Anionex merged 4 commits into
mainfrom
feat/anthropic-vision-client

Conversation

@Anionex

@Anionex Anionex commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add native VISION_API_PROTOCOL=anthropic support to the shared vision client.
  • Translate data URLs and remote image URLs into Anthropic Messages image blocks.
  • Send x-api-key and anthropic-version headers instead of Bearer auth in Anthropic mode.
  • Default to omitting the thinking field for model compatibility; allow explicit omit, disabled, or adaptive through VISION_ANTHROPIC_THINKING.
  • Join only response text blocks and ignore thinking blocks.
  • Retry Anthropic 529 overload responses and honor bounded Retry-After values.
  • Document the protocol, base-URL rule, authentication behavior, and thinking configuration in English and Chinese.

Verification

  • python3 -m py_compile vision_proxy.py vision_client.py ground.py detect.py bin/glance bin/trace bin/crop
  • python3 tests/test_vision_client.py
  • python3 tests/test_anthropic_rewrite.py
  • git diff --check
  • GitHub CI: Python 3.11, Python 3.14, Windows egress, and extensions passed on the first revision; rerun pending for the follow-up compatibility/retry commit.

This is a non-UI HTTP-client change; the affected request and retry paths are exercised by the local HTTP fixture in tests/test_vision_client.py.

Follow-up for Anionex/dsh-vision-toolkit#7.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@Anionex
Anionex merged commit ff042c7 into main Aug 14, 2026
4 checks passed
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