Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Improve the ITextToImageService abstractions to support ExecutionSettings #8068

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels Aug 12, 2024
@RogerBarreto RogerBarreto self-assigned this Aug 12, 2024
RogerBarreto and others added 5 commits August 12, 2024 11:09
- Added the GetImageContentsAsync method to the OpenAITextToImageService class.
- Implemented validation for input, including width, height, quality, and style settings.
- Supported image sizes include 256x256, 512x512, 1024x1024, 1792x1024, and 1024x1792.
- Added checks for supported qualities ('standard', 'hd') and styles ('vivid', 'natural').
- Constructed the request body for image generation and processed the response to handle both URLs and base64-encoded images.
- Converted image strings into ImageContent objects, ensuring proper handling of data URIs and HTTP URLs.
- Implemented unit tests for the GetImageContentsAsync method in OpenAITextToImageService.
- Added a test to verify that the method returns expected ImageContent when provided with valid input.
- Added parameterized tests using [Theory] and [InlineData] to cover a variety of scenarios:
  - Valid URL and base64 image data inputs.
  - Validation of input sizes, quality, and style parameters.
  - Ensured NotSupportedException is thrown for unsupported sizes, quality, and style.
- Tests ensure that both HTTP URLs and base64-encoded images are handled correctly, with proper assertions on the returned ImageContent objects.
.NET Add Style and Quality Parameters Support with Execution Settings
@aghimir3
Copy link

Hi @RogerBarreto , do we know when this might get merged to main?

@RogerBarreto
Copy link
Member Author

@aghimir3 Working to have this one in next weeks.

@RogerBarreto RogerBarreto marked this pull request as ready for review September 16, 2024 09:01
@RogerBarreto RogerBarreto requested a review from a team as a code owner September 16, 2024 09:01
@RogerBarreto RogerBarreto changed the title .Net: [WIP] Improving the ITextToImageService abstractions to support ExecutionSettings .Net: Improve the ITextToImageService abstractions to support ExecutionSettings Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel.core kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
None yet
6 participants