gpt-image-1 size missing in ImageEditParams
Problem
Confirm this is a Node library issue and not an underlying OpenAI API issue - [x] This is an issue with the Node library Describe the bug The `Images` type `ImageEditParams` is missing `size` for `gpt-image-1` model. Should align with the comment, to add extra sizes `'1536x1024'` | `'1024x1536'` | `'auto'` [code block] To Reproduce 1. Install latest v4.96.0 update 2. Import ImageEditParams with model `gpt-image-1` Code snippets [code block] OS macOS Node version v20.15.0 Library version 4.96.0
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Add Missing Size Parameter to ImageEditParams for gpt-image-1
The ImageEditParams type in the Node library version 4.96.0 does not include the 'size' parameter for the gpt-image-1 model. This omission prevents users from specifying the desired output dimensions, which should include '1536x1024', '1024x1536', and 'auto'. This issue arises from an incomplete type definition in the library's codebase.
Awaiting Verification
Be the first to verify this fix
- 1
Locate ImageEditParams Definition
Find the file where the ImageEditParams type is defined in the Node library. This is typically located in the 'types' or 'models' directory.
typescriptimport { ImageEditParams } from 'openai'; - 2
Add Size Parameter
Modify the ImageEditParams type definition to include the 'size' parameter with the appropriate union type for gpt-image-1. Ensure that the new sizes are correctly defined.
typescriptinterface ImageEditParams { model: 'gpt-image-1'; size?: '1536x1024' | '1024x1536' | 'auto'; } - 3
Update Documentation
Ensure that the library's documentation is updated to reflect the new 'size' parameter for the gpt-image-1 model. This helps users understand how to utilize the new feature effectively.
markdown// Update README.md or relevant documentation files. - 4
Run Tests
Execute existing unit tests to ensure that the addition of the 'size' parameter does not break any existing functionality. If necessary, add new tests to cover the new parameter.
bashnpm test - 5
Publish Update
Once all changes are verified and tested, publish the updated library version to npm to make the fix available to users.
bashnpm version patch && npm publish
Validation
To confirm the fix worked, import the updated ImageEditParams and check that the 'size' parameter is now available for the gpt-image-1 model. Create a sample request using the new parameter and verify that it functions as expected without errors.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep