2 types derived from ImageGenerationOptions
Microsoft.Extensions.AI.Abstractions.Tests (2)
Image\ImageGenerationOptionsTests.cs (2)
153private class OptionsA : ImageGenerationOptions 194private class PassedNullToBaseOptions : ImageGenerationOptions
29 instantiations of ImageGenerationOptions
Microsoft.Extensions.AI (2)
ChatCompletion\ImageGeneratingChatClient.cs (1)
383var options = _imageGenerationOptions ?? new ImageGenerationOptions();
Image\ConfigureOptionsImageGenerator.cs (1)
48options = options?.Clone() ?? new();
Microsoft.Extensions.AI.Abstractions (1)
Image\ImageGenerationOptions.cs (1)
95public virtual ImageGenerationOptions Clone() => new(this);
Microsoft.Extensions.AI.Abstractions.Tests (11)
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
Tools\HostedImageGenerationToolTests.cs (1)
43var 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 (7)
OpenAIConversionTests.cs (4)
268Options = new ImageGenerationOptions { MediaType = "image/png" } 283Options = new ImageGenerationOptions 314Options = new ImageGenerationOptions 346Options = new ImageGenerationOptions { MediaType = "image/png" }
OpenAIResponseClientTests.cs (3)
5384Options = new ImageGenerationOptions 5485Options = new ImageGenerationOptions 5602Options = 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()
82 references to ImageGenerationOptions
Microsoft.Extensions.AI (24)
ChatCompletion\ImageGeneratingChatClient.cs (2)
149private ImageGenerationOptions? _imageGenerationOptions; 383var options = _imageGenerationOptions ?? new ImageGenerationOptions();
ChatCompletion\OpenTelemetryImageGenerator.cs (2)
114ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default) 141private Activity? CreateAndConfigureActivity(ImageGenerationRequest request, ImageGenerationOptions? options)
Image\ConfigureOptionsImageGenerator.cs (12)
13/// <summary>Represents a delegating image generator that configures a <see cref="ImageGenerationOptions"/> instance used by the remainder of the pipeline.</summary> 18private readonly Action<ImageGenerationOptions> _configureOptions; 23/// The delegate to invoke to configure the <see cref="ImageGenerationOptions"/> instance. It is passed a clone of the caller-supplied <see cref="ImageGenerationOptions"/> instance 28/// The <paramref name="configure"/> delegate is passed either a new instance of <see cref="ImageGenerationOptions"/> if 29/// the caller didn't supply a <see cref="ImageGenerationOptions"/> instance, or a clone (via <see cref="ImageGenerationOptions.Clone"/> of the caller-supplied 32public ConfigureOptionsImageGenerator(IImageGenerator innerGenerator, Action<ImageGenerationOptions> configure) 40ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default) 45/// <summary>Creates and configures the <see cref="ImageGenerationOptions"/> to pass along to the inner generator.</summary> 46private ImageGenerationOptions Configure(ImageGenerationOptions? options)
Image\ConfigureOptionsImageGeneratorBuilderExtensions.cs (7)
16/// Adds a callback that configures a <see cref="ImageGenerationOptions"/> to be passed to the next generator in the pipeline. 20/// The delegate to invoke to configure the <see cref="ImageGenerationOptions"/> instance. 21/// 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"/>). 26/// <see cref="ImageGenerationOptions"/> if the caller didn't supply a <see cref="ImageGenerationOptions"/> instance, or a clone (via <see cref="ImageGenerationOptions.Clone"/>) 31this ImageGeneratorBuilder builder, Action<ImageGenerationOptions> configure)
Image\LoggingImageGenerator.cs (1)
59ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default)
Microsoft.Extensions.AI.Abstractions (18)
Image\DelegatingImageGenerator.cs (1)
45ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default)
Image\IImageGenerator.cs (1)
26Task<ImageGenerationResponse> GenerateAsync(ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default);
Image\ImageGenerationOptions.cs (9)
16/// <summary>Initializes a new instance of the <see cref="ImageGenerationOptions"/> class.</summary> 21/// <summary>Initializes a new instance of the <see cref="ImageGenerationOptions"/> class, performing a shallow copy of all properties from <paramref name="other"/>.</summary> 22protected ImageGenerationOptions(ImageGenerationOptions? other) 66/// When <see cref="IImageGenerator.GenerateAsync" /> is invoked with an <see cref="ImageGenerationOptions" />, 72/// <see cref="ImageGenerationOptions" /> instance or from other inputs, therefore, it is <b>strongly recommended</b> to not 75/// properties on <see cref="ImageGenerationOptions" />. 93/// <summary>Produces a clone of the current <see cref="ImageGenerationOptions"/> instance.</summary> 94/// <returns>A clone of the current <see cref="ImageGenerationOptions"/> instance.</returns> 95public virtual ImageGenerationOptions Clone() => new(this);
Image\ImageGeneratorExtensions.cs (4)
111ImageGenerationOptions? options = null, 134ImageGenerationOptions? options = null, 158ImageGenerationOptions? options = null, 186ImageGenerationOptions? options = null,
Image\ImageGeneratorMetadata.cs (1)
41/// An individual request may override this value via <see cref="ImageGenerationOptions.ModelId"/>.
Tools\HostedImageGenerationTool.cs (1)
44public ImageGenerationOptions? Options { get; set; }
Utilities\AIJsonUtilities.Defaults.cs (1)
158[JsonSerializable(typeof(ImageGenerationOptions))]
Microsoft.Extensions.AI.Abstractions.Tests (21)
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))]
Tools\HostedImageGenerationToolTests.cs (1)
43var options = new 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)
572ImageGenerationOptions? igo = 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)