fix: correct image_url parameter passing in images.edit()#3373
Conversation
The image_url parameter was not being correctly passed as the image input to the API endpoint. Fixes openai#3256
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d08d22e59
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| body = deepcopy_with_paths( | ||
| { | ||
| "image": image, | ||
| "image_url": image_url, |
There was a problem hiding this comment.
Send URL edits as JSON image references
For client.images.edit(image_url=...), this line adds a top-level image_url to the same body that is later forced through multipart/form-data (the file extraction still only knows about image/mask). The URL/file-id edit shape is a JSON request with an images array of reference objects, not a multipart form field named image_url, so the new image-url-only path still reaches /images/edits without a valid input image. Please serialize URL references through the JSON images=[{"image_url": ...}] shape (and avoid forcing multipart for that path) or keep requiring uploaded image until that shape is implemented.
Useful? React with 👍 / 👎.
Fixes image_url not being passed as image input parameter.
Fixes #3256