fix: Add Support for Proper Image Size Constraints#1413
Open
sfreeman422 wants to merge 6 commits intogoogleapis:mainfrom
Open
fix: Add Support for Proper Image Size Constraints#1413sfreeman422 wants to merge 6 commits intogoogleapis:mainfrom
sfreeman422 wants to merge 6 commits intogoogleapis:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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.
This pull request refactors the handling of image size configuration across several API and type definition files. The main improvement is the introduction of a dedicated
ImageSizeConfigtype, replacing the previous use of generic strings for specifying image sizes. This change enhances type safety and ensures that only supported image sizes can be used in the relevant interfaces.Type safety improvements for image size configuration:
ImageSizeConfigtype ('1K' | '2K' | '4K') to represent valid image sizes, replacing the previous untypedstringusage in image-related configuration interfaces. ([[1]](https://github.com/googleapis/js-genai/pull/1413/files#diff-5e6f47503bac0a3672b747dd68d8cad573b5e0d78c77b7a659488d98d39a93b5R1499-R1500),[[2]](https://github.com/googleapis/js-genai/pull/1413/files#diff-c54113cf61ec99691748a3890bfbeb00e10efb3f0a76f03a0fd9ec49072e410aR2348-R2349))imageSizeproperty in theImageConfiginterface to useImageSizeConfiginstead ofstringin both the TypeScript types and the generated API report files. ([[1]](https://github.com/googleapis/js-genai/pull/1413/files#diff-5e6f47503bac0a3672b747dd68d8cad573b5e0d78c77b7a659488d98d39a93b5L2008-R2010),[[2]](https://github.com/googleapis/js-genai/pull/1413/files#diff-20ae5185c323ce5cf41072fbd950bfa72b92eb8d3ccd8776c085b477bb361b6eL2008-R2008),[[3]](https://github.com/googleapis/js-genai/pull/1413/files#diff-c54113cf61ec99691748a3890bfbeb00e10efb3f0a76f03a0fd9ec49072e410aL2356-R2358))imageSizeproperty in theGenerateImagesConfiginterface to useImageSizeConfig(or a version omitting'4K'where not supported), replacing the previousstringtype in both the TypeScript types and the generated API report files. ([[1]](https://github.com/googleapis/js-genai/pull/1413/files#diff-5e6f47503bac0a3672b747dd68d8cad573b5e0d78c77b7a659488d98d39a93b5L1507-R1509),[[2]](https://github.com/googleapis/js-genai/pull/1413/files#diff-20ae5185c323ce5cf41072fbd950bfa72b92eb8d3ccd8776c085b477bb361b6eL1507-R1507),[[3]](https://github.com/googleapis/js-genai/pull/1413/files#diff-c54113cf61ec99691748a3890bfbeb00e10efb3f0a76f03a0fd9ec49072e410aL3487-R3489))These changes make the codebase more robust by preventing invalid image size values at compile time and clarifying the supported options for image generation.