18 instantiations of ImageGenerationOptions
Microsoft.Extensions.AI (1)
Image\ConfigureOptionsImageGenerator.cs (1)
47options = options?.Clone() ?? new();
Microsoft.Extensions.AI.Abstractions (1)
Image\ImageGenerationOptions.cs (1)
66ImageGenerationOptions options = new()
Microsoft.Extensions.AI.Abstractions.Tests (10)
Image\DelegatingImageGeneratorTests.cs (1)
24var expectedOptions = new ImageGenerationOptions();
Image\ImageGenerationOptionsTests.cs (4)
16ImageGenerationOptions options = new(); 36ImageGenerationOptions options = new(); 66ImageGenerationOptions options = new() 90ImageGenerationOptions original = new()
Image\ImageGeneratorExtensionsTests.cs (2)
66var options = new ImageGenerationOptions { Count = 2 }; 112var options = new ImageGenerationOptions { Count = 2 };
Image\ImageGeneratorTests.cs (3)
49var expectedOptions = new ImageGenerationOptions(); 105var options = new ImageGenerationOptions 132var options = new ImageGenerationOptions
Microsoft.Extensions.AI.Integration.Tests (3)
ImageGeneratorIntegrationTests.cs (3)
37var options = new ImageGenerationOptions 60var options = new ImageGenerationOptions 88var options = new ImageGenerationOptions
Microsoft.Extensions.AI.Tests (3)
Image\ConfigureOptionsImageGeneratorTests.cs (1)
33ImageGenerationOptions? providedOptions = nullProvidedOptions ? null : new() { ModelId = "test" };
Image\LoggingImageGeneratorTests.cs (2)
71new ImageGenerationOptions { ModelId = "dall-e-3" }); 120new ImageGenerationOptions { ModelId = "dall-e-3" });
66 references to ImageGenerationOptions
Microsoft.Extensions.AI (20)
Image\ConfigureOptionsImageGenerator.cs (12)
12/// <summary>Represents a delegating image generator that configures a <see cref="ImageGenerationOptions"/> instance used by the remainder of the pipeline.</summary> 17private readonly Action<ImageGenerationOptions> _configureOptions; 22/// The delegate to invoke to configure the <see cref="ImageGenerationOptions"/> instance. It is passed a clone of the caller-supplied <see cref="ImageGenerationOptions"/> instance 27/// The <paramref name="configure"/> delegate is passed either a new instance of <see cref="ImageGenerationOptions"/> if 28/// the caller didn't supply a <see cref="ImageGenerationOptions"/> instance, or a clone (via <see cref="ImageGenerationOptions.Clone"/> of the caller-supplied 31public ConfigureOptionsImageGenerator(IImageGenerator innerGenerator, Action<ImageGenerationOptions> configure) 39ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default) 44/// <summary>Creates and configures the <see cref="ImageGenerationOptions"/> to pass along to the inner generator.</summary> 45private ImageGenerationOptions Configure(ImageGenerationOptions? options)
Image\ConfigureOptionsImageGeneratorBuilderExtensions.cs (7)
17/// Adds a callback that configures a <see cref="ImageGenerationOptions"/> to be passed to the next generator in the pipeline. 21/// The delegate to invoke to configure the <see cref="ImageGenerationOptions"/> instance. 22/// It is passed a clone of the caller-supplied <see cref="ImageGenerationOptions"/> instance (or a newly constructed instance if the caller-supplied instance is <see langword="null"/>). 27/// <see cref="ImageGenerationOptions"/> if the caller didn't supply a <see cref="ImageGenerationOptions"/> instance, or a clone (via <see cref="ImageGenerationOptions.Clone"/>) 32this ImageGeneratorBuilder builder, Action<ImageGenerationOptions> configure)
Image\LoggingImageGenerator.cs (1)
59ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default)
Microsoft.Extensions.AI.Abstractions (15)
Image\DelegatingImageGenerator.cs (1)
44ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default)
Image\IImageGenerator.cs (1)
25Task<ImageGenerationResponse> GenerateAsync(ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default);
Image\ImageGenerationOptions.cs (7)
43/// When <see cref="IImageGenerator.GenerateAsync" /> is invoked with an <see cref="ImageGenerationOptions" />, 49/// <see cref="ImageGenerationOptions" /> instance or from other inputs, therefore, it is <b>strongly recommended</b> to not 52/// properties on <see cref="ImageGenerationOptions" />. 62/// <summary>Produces a clone of the current <see cref="ImageGenerationOptions"/> instance.</summary> 63/// <returns>A clone of the current <see cref="ImageGenerationOptions"/> instance.</returns> 64public virtual ImageGenerationOptions Clone() 66ImageGenerationOptions options = new()
Image\ImageGeneratorExtensions.cs (4)
110ImageGenerationOptions? options = null, 133ImageGenerationOptions? options = null, 157ImageGenerationOptions? options = null, 185ImageGenerationOptions? options = null,
Image\ImageGeneratorMetadata.cs (1)
40/// An individual request may override this value via <see cref="ImageGenerationOptions.ModelId"/>.
Utilities\AIJsonUtilities.Defaults.cs (1)
73[JsonSerializable(typeof(ImageGenerationOptions))]
Microsoft.Extensions.AI.Abstractions.Tests (17)
Image\DelegatingImageGeneratorTests.cs (1)
24var expectedOptions = new ImageGenerationOptions();
Image\ImageGenerationOptionsTests.cs (8)
16ImageGenerationOptions options = new(); 24ImageGenerationOptions clone = options.Clone(); 36ImageGenerationOptions options = new(); 54ImageGenerationOptions clone = options.Clone(); 66ImageGenerationOptions options = new() 77ImageGenerationOptions? deserialized = JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.ImageGenerationOptions); 90ImageGenerationOptions original = new() 99ImageGenerationOptions clone = original.Clone();
Image\ImageGeneratorExtensionsTests.cs (2)
66var options = new ImageGenerationOptions { Count = 2 }; 112var options = new ImageGenerationOptions { Count = 2 };
Image\ImageGeneratorTests.cs (3)
49var expectedOptions = new ImageGenerationOptions(); 105var options = new ImageGenerationOptions 132var options = new ImageGenerationOptions
TestImageGenerator.cs (2)
19public Func<ImageGenerationRequest, ImageGenerationOptions?, CancellationToken, Task<ImageGenerationResponse>>? GenerateImagesAsyncCallback { get; set; } 28public Task<ImageGenerationResponse> GenerateAsync(ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default)
TestJsonSerializerContext.cs (1)
24[JsonSerializable(typeof(ImageGenerationOptions))]
Microsoft.Extensions.AI.Integration.Tests (5)
ImageGeneratorIntegrationTests.cs (3)
37var options = new ImageGenerationOptions 60var options = new ImageGenerationOptions 88var options = new ImageGenerationOptions
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestImageGenerator.cs (2)
19public Func<ImageGenerationRequest, ImageGenerationOptions?, CancellationToken, Task<ImageGenerationResponse>>? GenerateImagesAsyncCallback { get; set; } 28public Task<ImageGenerationResponse> GenerateAsync(ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default)
Microsoft.Extensions.AI.OpenAI (5)
OpenAIImageGenerator.cs (5)
63public async Task<ImageGenerationResponse> GenerateAsync(ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default) 181/// <summary>Converts a <see cref="ImageGenerationOptions"/> to a <see cref="OpenAI.Images.ImageGenerationOptions"/>.</summary> 182private OpenAI.Images.ImageGenerationOptions ToOpenAIImageGenerationOptions(ImageGenerationOptions? options) 216/// <summary>Converts a <see cref="ImageGenerationOptions"/> to a <see cref="ImageEditOptions"/>.</summary> 217private ImageEditOptions ToOpenAIImageEditOptions(ImageGenerationOptions? options)
Microsoft.Extensions.AI.Tests (4)
Image\ConfigureOptionsImageGeneratorTests.cs (2)
33ImageGenerationOptions? providedOptions = nullProvidedOptions ? null : new() { ModelId = "test" }; 34ImageGenerationOptions? returnedOptions = null;
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestImageGenerator.cs (2)
19public Func<ImageGenerationRequest, ImageGenerationOptions?, CancellationToken, Task<ImageGenerationResponse>>? GenerateImagesAsyncCallback { get; set; } 28public Task<ImageGenerationResponse> GenerateAsync(ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default)