Skip to content

feat(review): accept image uploads (.png, .jpg, .webp) and document URL inputs - #137

Merged
lenzhq merged 1 commit into
mainfrom
feat/image-and-url-support
Oct 31, 2026
Merged

lenzhq merged 1 commit into
mainfrom
feat/image-and-url-support

Conversation

@lenzhq

@lenzhq lenzhq commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Summary

Extends review_file, review_file_and_wait, and CLI lenz review in the Python SDK (lenz-io) to accept standalone image uploads (.png, .jpg, .jpeg, .webp) alongside .docx and .pdf, includes /review/file in _REVIEW_FAMILY, and updates documentation for Google Docs and direct image URL inputs.

Changes

  • src/lenz_io/_shared.py (_prepare_review_file_multipart):
    • Accept .png (image/png), .jpg/.jpeg (image/jpeg), and .webp (image/webp) filenames in addition to .docx and .pdf.
  • src/lenz_io/cli/review.py (_is_binary_document, _resolve_draft_input, review):
    • Auto-detect .png, .jpg, .jpeg, and .webp files in lenz review <file> and upload via review_file().
  • src/lenz_io/errors.py:
    • Include /review/file in _REVIEW_FAMILY (matching Node SDK src/compat.ts).
  • src/lenz_io/client.py, src/lenz_io/async_client.py, README.md, CHANGELOG.md:
    • Document image file uploads and Google Docs + direct image URL support.
  • tests/test_review.py, tests/test_cli_review.py, tests/test_errors.py:
    • Add unit tests for image upload MIME types, CLI binary image dispatch, unsupported extension error messages, and _REVIEW_FAMILY matching on /review/file.

Reviews & Verification

  • Astra review (codex review --base origin/main) & Opus review (claude -p --model opus): Reviewed commit 6a77782; all findings addressed.
  • Tests: ruff check, ruff format --check, mypy src (strict), and pytest (5,619 passed) all passing.

Post-deploy actions & prod testing

  • Merge after the corresponding API PR (lenzhq/Lenz#1575) is merged and deployed to production.
  • Refresh openapi.json from the live API and release in parity with lenzhq/lenz-io-node.

@lenzhq
lenzhq requested a review from paveljor as a code owner October 31, 2026 15:00
@lenzhq
lenzhq merged commit 1cb957e into main Oct 31, 2026
13 checks passed
@lenzhq
lenzhq deleted the feat/image-and-url-support branch October 31, 2026 15:32
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