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 Add Style and Quality Parameters Support with Execution Settings #4

Commits on Aug 14, 2024

  1. Configuration menu
    Copy the full SHA
    201423b View commit details
    Browse the repository at this point in the history
  2. Implement GetImageContentsAsync in OpenAITextToImageService

    - 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.
    aghimir3 committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    6895c05 View commit details
    Browse the repository at this point in the history
  3. Add unit tests for GetImageContentsAsync method

    - 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.
    aghimir3 committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    ef12678 View commit details
    Browse the repository at this point in the history