Skip to content

Conversation

pgrayy
Copy link
Member

@pgrayy pgrayy commented Jun 19, 2025

Description

In the OpenAI model provider, we currently expect people to pass in base64 encoded data for images. This isn't conventional. As with the other providers like Anthropic and Bedrock, we should accept raw image bytes and base64 encode on behalf of the customers.

In this PR, we put in a fix to the OpenAI model provider to allow both raw bytes and base64 encoded bytes. In the 1.0 release, we should switch to only allowing raw bytes and always perform the base64 encoding on behalf of customers.

Related Issues

No formal issue has been opened, but this is causing compatibility issues with the generate_image tool which passes through raw bytes as a result.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

zastrowm
zastrowm previously approved these changes Jun 19, 2025
Co-authored-by: Mackenzie Zastrow <3211021+zastrowm@users.noreply.github.com>
@pgrayy pgrayy merged commit 40f622a into strands-agents:main Jun 19, 2025
12 checks passed
@pgrayy pgrayy deleted the image-b64 branch June 19, 2025 13:16
@zastrowm
Copy link
Member

Related to issue #252

Unshure pushed a commit to Unshure/sdk-python that referenced this pull request Jul 2, 2025
jsamuel1 pushed a commit to jsamuel1/sdk-python that referenced this pull request Jul 9, 2025
dbschmigelski pushed a commit to Ketansuhaas/sdk-python that referenced this pull request Jul 24, 2025
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.

2 participants