Class ChoicesStage<R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest,E extends RuntimeSelectionStage>

java.lang.Object
bg.codexio.ai.openai.api.sdk.images.ImageConfigurationStage<R>
bg.codexio.ai.openai.api.sdk.images.ChoicesStage<R,E>
All Implemented Interfaces:
IntermediateStage

public class ChoicesStage<R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest,E extends RuntimeSelectionStage> extends ImageConfigurationStage<R> implements IntermediateStage
A stage to choose the number of the images generated.

Currently, this is supported only by dall-e-2 model

  • Method Details

    • withChoices

      public Dalle2SizeStage<R,E> withChoices(Integer choices)
      Parameters:
      choices - the desired number of the images output

      Sets the number of generated images to the desired one.
      Important note: The min count is 1 and the max count is 10. If a different count is passed, it will result in error is the API response.

      Returns:
      Dalle2SizeStage to configure the dimensions of the images.
    • singleChoice

      public Dalle2SizeStage<R,E> singleChoice()
      Sets the number of generated images to one only.
      Returns:
      Dalle2SizeStage to configure the dimensions of the images.