19 instantiations of ImageGenerationOptions
Microsoft.Extensions.AI (1)
Image\ConfigureOptionsImageGenerator.cs (1)
47options = options?.Clone() ?? new();
Microsoft.Extensions.AI.Abstractions (1)
Image\ImageGenerationOptions.cs (1)
69ImageGenerationOptions 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)
48var expectedOptions = new ImageGenerationOptions(); 104var options = new ImageGenerationOptions 131var 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 (4)
Image\ConfigureOptionsImageGeneratorTests.cs (1)
33ImageGenerationOptions? providedOptions = nullProvidedOptions ? null : new() { ModelId = "test" };
Image\LoggingImageGeneratorTests.cs (2)
70new ImageGenerationOptions { ModelId = "dall-e-3" }); 119new ImageGenerationOptions { ModelId = "dall-e-3" });
Image\OpenTelemetryImageGeneratorTests.cs (1)
77ImageGenerationOptions options = new()
69 references to ImageGenerationOptions
Microsoft.Extensions.AI (22)
ChatCompletion\OpenTelemetryImageGenerator.cs (2)
117ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default) 144private Activity? CreateAndConfigureActivity(ImageGenerationRequest request, ImageGenerationOptions? options)
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)
15/// Adds a callback that configures a <see cref="ImageGenerationOptions"/> to be passed to the next generator in the pipeline. 19/// The delegate to invoke to configure the <see cref="ImageGenerationOptions"/> instance. 20/// 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"/>). 25/// <see cref="ImageGenerationOptions"/> if the caller didn't supply a <see cref="ImageGenerationOptions"/> instance, or a clone (via <see cref="ImageGenerationOptions.Clone"/>) 30this ImageGeneratorBuilder builder, Action<ImageGenerationOptions> configure)
Image\LoggingImageGenerator.cs (1)
58ImageGenerationRequest 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" />. 65/// <summary>Produces a clone of the current <see cref="ImageGenerationOptions"/> instance.</summary> 66/// <returns>A clone of the current <see cref="ImageGenerationOptions"/> instance.</returns> 67public virtual ImageGenerationOptions Clone() 69ImageGenerationOptions 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)
48var expectedOptions = new ImageGenerationOptions(); 104var options = new ImageGenerationOptions 131var 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)
53public async Task<ImageGenerationResponse> GenerateAsync(ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default) 188/// <summary>Converts a <see cref="ImageGenerationOptions"/> to a <see cref="OpenAI.Images.ImageGenerationOptions"/>.</summary> 189private OpenAI.Images.ImageGenerationOptions ToOpenAIImageGenerationOptions(ImageGenerationOptions? options) 223/// <summary>Converts a <see cref="ImageGenerationOptions"/> to a <see cref="ImageEditOptions"/>.</summary> 224private ImageEditOptions ToOpenAIImageEditOptions(ImageGenerationOptions? options)
Microsoft.Extensions.AI.Tests (5)
Image\ConfigureOptionsImageGeneratorTests.cs (2)
33ImageGenerationOptions? providedOptions = nullProvidedOptions ? null : new() { ModelId = "test" }; 34ImageGenerationOptions? returnedOptions = null;
Image\OpenTelemetryImageGeneratorTests.cs (1)
77ImageGenerationOptions options = new()
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)