fix(dalle): Add tests and fix issue 106 quality param handling #109
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.
Summary
Fixed issue #106 as follows: for dall-e-2 (default), I ignore it. For dall-e-3, it takes it into consideration. Confirmed with both version and added unit tests that also validate the changes. As there were no unit tests at all, I added one file with the appropriate tests. My assumption is subsequent dall-e versions will accept the quality parameter, so it is - hopefully - future proofed.
Changes
quality
parameter: Therun
method indalle_image_generator.py
has been updated to conditionally include thequality
parameter only when the selected model is notdall-e-2
. This prevents an API error while maintaining functionality for DALL-E 3 and future models.test_dalle_image_generator.py
, has been addedCloses Issue #106