Skip to content

Conversation

@jamesbraza
Copy link
Collaborator

Giving clients a bit more flexibility

@jamesbraza jamesbraza self-assigned this Jan 13, 2026
@jamesbraza jamesbraza added the enhancement New feature or request label Jan 13, 2026
Copilot AI review requested due to automatic review settings January 13, 2026 22:32
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jan 13, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the image handling capabilities of Message.create_message to accept raw bytes as an image input type, providing more flexibility to clients who may have image data as bytes rather than numpy arrays or base64 strings.

Changes:

  • Updated encode_image_to_base64 function in utils.py to handle bytes input by opening it with PIL's Image.open()
  • Updated type hints and documentation in message.py to reflect the new bytes support
  • Added test coverage for bytes input in test_encode_image_to_base64 test function

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/aviary/utils.py Added logic to handle bytes input by using Image.open(io.BytesIO(img)) and refactored the conditional logic to be more explicit
src/aviary/message.py Updated type hints for the images parameter and documentation to include bytes as a supported image type
tests/test_utils.py Renamed test function from test_encode_image_to_base64_pil to test_encode_image_to_base64 and added a new subtest for bytes input

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jan 13, 2026
@jamesbraza jamesbraza merged commit 635b0f4 into main Jan 14, 2026
5 checks passed
@jamesbraza jamesbraza deleted the img-bytes branch January 14, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants