Skip to content

Conversation

y-sudharshan
Copy link

@y-sudharshan y-sudharshan commented Sep 9, 2025

  • Accept base64, URL, and bytes for image input
  • Update payload construction and validation
  • Add documentation and tests for image scenarios
  • Ensure backward compatibility with text-only input

Description

This pull request adds image input support to the Google Gemini and Vertex providers in any-llm. The changes include:

Extending the input interface to accept images as base64-encoded strings, URLs, or raw bytes in the [messages] parameter.
Updating the payload construction and validation logic to handle image data according to Gemini and Vertex API requirements.
Implementing error handling for invalid image formats, corrupt data, and unsupported types.
Updating documentation (README and API docs) with clear instructions and examples for sending images.
Adding unit and integration tests for valid and invalid image input scenarios.
Ensuring backward compatibility so existing text-only workflows remain unaffected.
These changes enable multimodal (text + image) support for Gemini and Vertex, making any-llm more flexible for developers.

Checklist

  • I have added unit tests that prove my fix/feature works
  • New and existing tests pass locally
  • Documentation was updated where necessary
  • I have read and followed the contribution guidelines```

y-sudharshan and others added 2 commits September 9, 2025 16:20
- Accept base64, URL, and bytes for image input
- Update payload construction and validation
- Add documentation and tests for image scenarios
- Ensure backward compatibility with text-only input
@codecov
Copy link

codecov bot commented Sep 10, 2025

Codecov Report

❌ Patch coverage is 15.00000% with 17 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/any_llm/providers/gemini/utils.py 15.00% 13 Missing and 4 partials ⚠️
Files with missing lines Coverage Δ
src/any_llm/providers/gemini/utils.py 55.08% <15.00%> (-33.92%) ⬇️

... and 27 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

This PR is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 3 days.

@github-actions github-actions bot added the Stale label Sep 25, 2025
@github-actions github-actions bot removed the Stale label Sep 30, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

This PR is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 3 days.

@github-actions github-actions bot added the Stale label Oct 8, 2025
@github-actions github-actions bot removed the Stale label Oct 11, 2025
@github-actions
Copy link
Contributor

This PR is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 3 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant