Skip to content

feat: accept base64 image data URIs - #752

Open
WitBlue6 wants to merge 1 commit into
ollama:mainfrom
WitBlue6:feat/image-data-uri
Open

WitBlue6 wants to merge 1 commit into
ollama:mainfrom
WitBlue6:feat/image-data-uri

Conversation

@WitBlue6

Copy link
Copy Markdown

Summary

Allow Image(value=...) to accept data:image/...;base64,... strings produced by browsers and web apps. The serializer validates the payload and sends the raw Base64 content expected by Ollama; malformed or non-image data URIs now raise a clear ValueError.

Tests

  • pytest -q tests — 120 passed (with localhost excluded from the machine's proxy)
  • ruff check ollama/_types.py tests/test_image_data_uri.py
  • ruff format --check ollama/_types.py tests/test_image_data_uri.py

This branch has not been deployed

No deployments
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