2 types derived from ImageGenerationOptions
Microsoft.Extensions.AI.Abstractions.Tests (2)
Image\ImageGenerationOptionsTests.cs (2)
153private class OptionsA : ImageGenerationOptions 194private class PassedNullToBaseOptions : ImageGenerationOptions
24 instantiations of ImageGenerationOptions
Microsoft.Extensions.AI (2)
ChatCompletion\ImageGeneratingChatClient.cs (1)
382var options = _imageGenerationOptions ?? new ImageGenerationOptions();
Image\ConfigureOptionsImageGenerator.cs (1)
47options = options?.Clone() ?? new();
Microsoft.Extensions.AI.Abstractions (1)
Image\ImageGenerationOptions.cs (1)
94public virtual ImageGenerationOptions Clone() => new(this);
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 (4)
ImageGeneratingChatClientIntegrationTests.cs (1)
329var imageGenerationOptions = new ImageGenerationOptions
ImageGeneratorIntegrationTests.cs (3)
37var options = new ImageGenerationOptions 70var options = new ImageGenerationOptions 98var options = new ImageGenerationOptions
Microsoft.Extensions.AI.OpenAI.Tests (3)
OpenAIResponseClientTests.cs (3)
4832Options = new ImageGenerationOptions 4934Options = new ImageGenerationOptions 5052Options = 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()
81 references to ImageGenerationOptions
Microsoft.Extensions.AI (24)
ChatCompletion\ImageGeneratingChatClient.cs (2)
148private ImageGenerationOptions? _imageGenerationOptions; 382var options = _imageGenerationOptions ?? new ImageGenerationOptions();
ChatCompletion\OpenTelemetryImageGenerator.cs (2)
113ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default) 140private 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 (18)
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 (9)
15/// <summary>Initializes a new instance of the <see cref="ImageGenerationOptions"/> class.</summary> 20/// <summary>Initializes a new instance of the <see cref="ImageGenerationOptions"/> class, performing a shallow copy of all properties from <paramref name="other"/>.</summary> 21protected ImageGenerationOptions(ImageGenerationOptions? other) 65/// When <see cref="IImageGenerator.GenerateAsync" /> is invoked with an <see cref="ImageGenerationOptions" />, 71/// <see cref="ImageGenerationOptions" /> instance or from other inputs, therefore, it is <b>strongly recommended</b> to not 74/// properties on <see cref="ImageGenerationOptions" />. 92/// <summary>Produces a clone of the current <see cref="ImageGenerationOptions"/> instance.</summary> 93/// <returns>A clone of the current <see cref="ImageGenerationOptions"/> instance.</returns> 94public virtual ImageGenerationOptions Clone() => new(this);
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"/>.
Tools\HostedImageGenerationTool.cs (1)
26public ImageGenerationOptions? Options { get; set; }
Utilities\AIJsonUtilities.Defaults.cs (1)
158[JsonSerializable(typeof(ImageGenerationOptions))]
Microsoft.Extensions.AI.Abstractions.Tests (20)
Image\DelegatingImageGeneratorTests.cs (1)
24var expectedOptions = new ImageGenerationOptions();
Image\ImageGenerationOptionsTests.cs (11)
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(); 146ImageGenerationOptions clone = b.Clone(); 167public override ImageGenerationOptions Clone() => new OptionsA(this); 184public override ImageGenerationOptions Clone() => new OptionsB(this);
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 (8)
ImageGeneratingChatClientIntegrationTests.cs (3)
329var imageGenerationOptions = new ImageGenerationOptions 410public List<(ImageGenerationRequest request, ImageGenerationOptions? options)> GenerateCalls { get; } = []; 413public Task<ImageGenerationResponse> GenerateAsync(ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default)
ImageGeneratorIntegrationTests.cs (3)
37var options = new ImageGenerationOptions 70var options = new ImageGenerationOptions 98var 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 (6)
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)
OpenAIResponsesChatClient.cs (1)
604ImageGenerationOptions? imageGenerationOptions = imageGenerationTool.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)