Class VisualMediaGenerationRequest<TTask, TPrompt, TOutput, TChunk, TEvent>
public abstract class VisualMediaGenerationRequest<TTask, TPrompt, TOutput, TChunk, TEvent> : GenerativeRequest<TTask, TPrompt, TOutput, TChunk, TEvent>, IGenerativeRequest, ISequentialRequest where TTask : VisualMediaGenerationRequest<TTask, TPrompt, TOutput, TChunk, TEvent> where TPrompt : IPrompt where TOutput : IGeneratedOutput where TEvent : IGenerativeEvent<TChunk, TOutput>
Type Parameters
TTaskTPromptTOutputTChunkTEvent
- Inheritance
-
objectFluentApiRequest<TTask, TOutput>GenerativeRequest<TTask, TPrompt, TOutput, TChunk, TEvent>VisualMediaGenerationRequest<TTask, TPrompt, TOutput, TChunk, TEvent>
- Implements
- Derived
- Inherited Members
-
GenerativeRequest<TTask, TPrompt, TOutput, TChunk, TEvent>.SetRecordMergeOptions(RecordMergeOptions)
- Extension Methods
Constructors
VisualMediaGenerationRequest(TPrompt)
protected VisualMediaGenerationRequest(TPrompt prompt)
Parameters
promptTPrompt
Properties
AspectRatio
public GoogleTypes.AspectRatio? AspectRatio { get; set; }
Property Value
Background
Allows to set transparency for the background of the generated image(s).
This parameter is only supported for gpt-image-1.
Must be one of transparent, opaque or auto (default value).
When auto is used, the model will automatically determine the best background for the image.
If transparent, the output format needs to support transparency,
so it should be set to either png (default value) or webp.
public ImageBackground? Background { get; set; }
Property Value
ImageFormat
The format of the response.
public GeneratedImageFormat? ImageFormat { get; set; }
Property Value
Moderation
Control the content-moderation level for images generated by gpt-image-1. Must be either low for less restrictive filtering or auto (default value).
public string Moderation { get; set; }
Property Value
- string
OutputCompression
The compression level (0-100%) for the generated images. This parameter is only supported for gpt-image-1 with the webp or jpeg output formats, and defaults to 100.
public ImageCompressionLevel OutputCompression { get; set; }
Property Value
PersonGeneration
public GoogleTypes.PersonGeneration? PersonGeneration { get; set; }
Property Value
Quality
The quality of the image that will be generated. ImageQuality.HighDefinition creates images with finer details and greater consistency across the image. This param is only supported for DallE3.
public ImageQuality? Quality { get; set; }
Property Value
Remarks
Defaults to ImageQuality.Standard
Size
public ImageSize? Size { get; set; }
Property Value
Style
The style of the generated images. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for DallE3.
public OpenAITypes.ImageStyle? Style { get; set; }
Property Value
Remarks
Defaults to ImageStyle.Vivid
Methods
GetRequestParameters()
public override Dictionary<string, object> GetRequestParameters()
Returns
- Dictionary<string, object>
SetAspectRatio(AspectRatio)
public TTask SetAspectRatio(GoogleTypes.AspectRatio aspectRatio)
Parameters
aspectRatioGoogleTypes.AspectRatio
Returns
- TTask
SetPersonGeneration(PersonGeneration)
public TTask SetPersonGeneration(GoogleTypes.PersonGeneration personGeneration)
Parameters
personGenerationGoogleTypes.PersonGeneration
Returns
- TTask
SetQuality(ImageQuality)
public TTask SetQuality(ImageQuality quality)
Parameters
qualityImageQuality
Returns
- TTask
SetSize(ImageSize)
public TTask SetSize(ImageSize size)
Parameters
sizeImageSize
Returns
- TTask
SetStyle(ImageStyle)
public TTask SetStyle(OpenAITypes.ImageStyle style)
Parameters
styleOpenAITypes.ImageStyle
Returns
- TTask