Jboudreau/support gpt image models#457
Open
joe-boudreau wants to merge 12 commits intoaallam:mainfrom
Open
Conversation
joe-boudreau
commented
Jan 17, 2026
|
|
||
| internal fun FormBuilder.appendFileSource(key: String, fileSource: FileSource) { | ||
| append(key = key, filename = fileSource.name, contentType = ContentType.Application.OctetStream) { | ||
| append(key = key, filename = fileSource.name, contentType = ContentType.parse(fileSource.contentType)) { |
Author
There was a problem hiding this comment.
these tests were failing now because the OpenAI API doesn't support application/octet-stream as a valid content type anymore. it needs to be image/png
Author
|
@aallam can you please review this - it's ready to be merged if you agree with the changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your change
ImagesApiwith 4 new methods:These are meant to replace the
imageURLandimageJsonmethods in this interface once the Dall-E models are deprecated and removed in May 2026. I elected to leave them in for now to make this a backwards compatible library update. A future library update ( after May 2026) should remove these methods and simplify the API.The OpenAI Images API only supports base_64 encoded JSON images now, the external URL option will be gone once the Dall-E models are deprecated. So the new interface methods represent that future state.
What problem is this fixing?
Dall-E Deprecation
In May 2026, OpenAI will be removing the Dall-E Image models from their API:
https://platform.openai.com/docs/deprecations#2025-11-14-dall-e-model-snapshots
These models will be unavailable after that.
In addition, the image variation endpoint is only supported by
dall-e-2: https://platform.openai.com/docs/api-reference/images/createVariationSo presumably it will also be removed when the models are removed.
GPT Image support
The new class of image models (
gpt-image-*) aren't supported by theImageinterface in this library currently because it doesn't allow NOT setting theresponse_formatfield in the request. Requests with this field are rejected by OpenAI because that field is only supported by the Dall-E models:So the updates to the
Imageinterface make this an optional field so you can actually use the GPT Image models now.https://platform.openai.com/docs/api-reference/images