8000 models - openai - images - b64 validate by pgrayy · Pull Request #251 · strands-agents/sdk-python · GitHub
[go: up one dir, main page]

Skip to content

models - openai - images - b64 validate #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 19, 2025
Merged

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.

8000
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

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
0