4 types derived from ImageGenerationOptions
Microsoft.Extensions.AI.Abstractions.Tests (2)
Image\ImageGenerationOptionsTests.cs (2)
157private class OptionsA : ImageGenerationOptions 198private class PassedNullToBaseOptions : ImageGenerationOptions
Microsoft.Extensions.AI.Stabilization.Tests (2)
parent\Microsoft.Extensions.AI.Abstractions.Tests\Image\ImageGenerationOptionsTests.cs (2)
157private class OptionsA : ImageGenerationOptions 198private class PassedNullToBaseOptions : ImageGenerationOptions
37 instantiations of ImageGenerationOptions
Microsoft.Extensions.AI (2)
ChatCompletion\ImageGeneratingChatClient.cs (1)
380var options = _imageGenerationOptions ?? new ImageGenerationOptions();
Image\ConfigureOptionsImageGenerator.cs (1)
48options = options?.Clone() ?? new();
Microsoft.Extensions.AI.Abstractions (2)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.ImageGenerationOptions.g.cs (1)
33ObjectCreator = () => new global::Microsoft.Extensions.AI.ImageGenerationOptions(),
Image\ImageGenerationOptions.cs (1)
94public virtual ImageGenerationOptions Clone() => new(this);
Microsoft.Extensions.AI.Abstractions.Tests (12)
Generated\361d1da7f942c932\TestJsonSerializerContext.ImageGenerationOptions.g.cs (1)
31ObjectCreator = () => new global::Microsoft.Extensions.AI.ImageGenerationOptions(),
Image\DelegatingImageGeneratorTests.cs (1)
24var expectedOptions = new ImageGenerationOptions();
Image\ImageGenerationOptionsTests.cs (4)
16ImageGenerationOptions options = new(); 36ImageGenerationOptions options = new(); 68ImageGenerationOptions options = new() 92ImageGenerationOptions 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)
328var imageGenerationOptions = new ImageGenerationOptions
ImageGeneratorIntegrationTests.cs (3)
36var options = new ImageGenerationOptions 69var options = new ImageGenerationOptions 97var options = new ImageGenerationOptions
Microsoft.Extensions.AI.OpenAI.Tests (8)
OpenAIConversionTests.cs (4)
372Options = new ImageGenerationOptions { MediaType = "image/png" } 387Options = new ImageGenerationOptions 418Options = new ImageGenerationOptions 449Options = new ImageGenerationOptions { MediaType = "image/png" }
OpenAIResponseClientIntegrationTests.cs (1)
151Options = new ImageGenerationOptions { ModelId = imageModel },
OpenAIResponseClientTests.cs (3)
6361Options = new ImageGenerationOptions 6462Options = new ImageGenerationOptions 6579Options = new ImageGenerationOptions
Microsoft.Extensions.AI.Stabilization.Tests (5)
parent\Microsoft.Extensions.AI.Abstractions.Tests\Image\ImageGenerationOptionsTests.cs (4)
16ImageGenerationOptions options = new(); 36ImageGenerationOptions options = new(); 68ImageGenerationOptions options = new() 92ImageGenerationOptions original = new()
parent\Microsoft.Extensions.AI.Abstractions.Tests\Tools\HostedImageGenerationToolTests.cs (1)
43var 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)
79ImageGenerationOptions options = new()
196 references to ImageGenerationOptions
Microsoft.Extensions.AI (24)
ChatCompletion\ImageGeneratingChatClient.cs (2)
149private ImageGenerationOptions? _imageGenerationOptions; 380var options = _imageGenerationOptions ?? new ImageGenerationOptions();
ChatCompletion\OpenTelemetryImageGenerator.cs (2)
105ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default) 132private 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 (66)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
220if (type == typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.ImageGenerationOptions.g.cs (47)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ImageGenerationOptions>? _ImageGenerationOptions; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ImageGenerationOptions> ImageGenerationOptions 24get => _ImageGenerationOptions ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ImageGenerationOptions>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ImageGenerationOptions> Create_ImageGenerationOptions(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.ImageGenerationOptions>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ImageGenerationOptions> jsonTypeInfo)) 31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.ImageGenerationOptions> 37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null), 41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.ImageGenerationOptions>(options, objectInfo); 58DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 60Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).Count, 61Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).Count = value!, 68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("Count", InstanceMemberBindingFlags, null, typeof(int?), global::System.Array.Empty<global::System.Type>(), null), 78DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 80Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).ImageSize, 81Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).ImageSize = value!, 88AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("ImageSize", InstanceMemberBindingFlags, null, typeof(global::System.Drawing.Size?), global::System.Array.Empty<global::System.Type>(), null), 98DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 100Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).MediaType, 101Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).MediaType = value!, 108AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("MediaType", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 118DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 120Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).ModelId, 121Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).ModelId = value!, 128AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("ModelId", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 138DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 158DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 160Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).ResponseFormat, 161Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).ResponseFormat = value!, 168AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("ResponseFormat", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.ImageGenerationResponseFormat?), global::System.Array.Empty<global::System.Type>(), null), 178DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 180Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).StreamingCount, 181Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).StreamingCount = value!, 188AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("StreamingCount", InstanceMemberBindingFlags, null, typeof(int?), global::System.Array.Empty<global::System.Type>(), null), 198DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 200Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).AdditionalProperties, 201Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).AdditionalProperties = value!, 208AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("AdditionalProperties", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.AdditionalPropertiesDictionary), global::System.Array.Empty<global::System.Type>(), null), 218private void ImageGenerationOptionsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.Extensions.AI.ImageGenerationOptions? value) 228int? __value_Count = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).Count; 234global::System.Drawing.Size? __value_ImageSize = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).ImageSize; 240string __value_MediaType = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).MediaType; 245string __value_ModelId = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).ModelId; 250global::Microsoft.Extensions.AI.ImageGenerationResponseFormat? __value_ResponseFormat = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).ResponseFormat; 256int? __value_StreamingCount = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).StreamingCount; 262global::Microsoft.Extensions.AI.AdditionalPropertiesDictionary __value_AdditionalProperties = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).AdditionalProperties;
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)
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)
99ImageGenerationOptions? options = null, 122ImageGenerationOptions? options = null, 146ImageGenerationOptions? options = null, 174ImageGenerationOptions? options = null,
Image\ImageGeneratorMetadata.cs (1)
41/// An individual request may override this value via <see cref="ImageGenerationOptions.ModelId"/>.
Tools\HostedImageGenerationTool.cs (1)
41public ImageGenerationOptions? Options { get; set; }
Utilities\AIJsonUtilities.Defaults.cs (1)
139[JsonSerializable(typeof(ImageGenerationOptions))]
Microsoft.Extensions.AI.Abstractions.Tests (72)
Generated\361d1da7f942c932\TestJsonSerializerContext.GetJsonTypeInfo.g.cs (1)
222if (type == typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions))
Generated\361d1da7f942c932\TestJsonSerializerContext.ImageGenerationOptions.g.cs (47)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ImageGenerationOptions>? _ImageGenerationOptions; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ImageGenerationOptions> ImageGenerationOptions 22get => _ImageGenerationOptions ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ImageGenerationOptions>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ImageGenerationOptions> Create_ImageGenerationOptions(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.ImageGenerationOptions>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ImageGenerationOptions> jsonTypeInfo)) 29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.ImageGenerationOptions> 35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null), 39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.ImageGenerationOptions>(options, objectInfo); 56DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 58Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).Count, 59Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).Count = value!, 66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("Count", InstanceMemberBindingFlags, null, typeof(int?), global::System.Array.Empty<global::System.Type>(), null), 76DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 78Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).ImageSize, 79Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).ImageSize = value!, 86AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("ImageSize", InstanceMemberBindingFlags, null, typeof(global::System.Drawing.Size?), global::System.Array.Empty<global::System.Type>(), null), 96DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 98Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).MediaType, 99Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).MediaType = value!, 106AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("MediaType", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 116DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 118Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).ModelId, 119Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).ModelId = value!, 126AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("ModelId", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 136DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 156DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 158Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).ResponseFormat, 159Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).ResponseFormat = value!, 166AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("ResponseFormat", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.ImageGenerationResponseFormat?), global::System.Array.Empty<global::System.Type>(), null), 176DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 178Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).StreamingCount, 179Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).StreamingCount = value!, 186AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("StreamingCount", InstanceMemberBindingFlags, null, typeof(int?), global::System.Array.Empty<global::System.Type>(), null), 196DeclaringType = typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions), 198Getter = static obj => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).AdditionalProperties, 199Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ImageGenerationOptions)obj).AdditionalProperties = value!, 206AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ImageGenerationOptions).GetProperty("AdditionalProperties", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.AdditionalPropertiesDictionary), global::System.Array.Empty<global::System.Type>(), null), 216private void ImageGenerationOptionsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.Extensions.AI.ImageGenerationOptions? value) 226int? __value_Count = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).Count; 232global::System.Drawing.Size? __value_ImageSize = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).ImageSize; 238string __value_MediaType = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).MediaType; 243string __value_ModelId = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).ModelId; 248global::Microsoft.Extensions.AI.ImageGenerationResponseFormat? __value_ResponseFormat = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).ResponseFormat; 254int? __value_StreamingCount = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).StreamingCount; 260global::Microsoft.Extensions.AI.AdditionalPropertiesDictionary __value_AdditionalProperties = ((global::Microsoft.Extensions.AI.ImageGenerationOptions)value).AdditionalProperties;
Image\DelegatingImageGeneratorTests.cs (1)
24var expectedOptions = new ImageGenerationOptions();
Image\ImageGenerationOptionsTests.cs (14)
16ImageGenerationOptions options = new(); 24ImageGenerationOptions clone = options.Clone(); 36ImageGenerationOptions options = new(); 56ImageGenerationOptions clone = options.Clone(); 68ImageGenerationOptions options = new() 79ImageGenerationOptions? deserialized = JsonSerializer.Deserialize<ImageGenerationOptions>(json, AIJsonUtilities.DefaultOptions); 92ImageGenerationOptions original = new() 101ImageGenerationOptions clone = original.Clone(); 150ImageGenerationOptions clone = b.Clone(); 171public override ImageGenerationOptions Clone() => new OptionsA(this); 188public override ImageGenerationOptions Clone() => new OptionsB(this); 226ImageGenerationOptions? result = JsonSerializer.Deserialize<ImageGenerationOptions>(Json, AIJsonUtilities.DefaultOptions);
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)
28[JsonSerializable(typeof(ImageGenerationOptions))]
Tools\HostedImageGenerationToolTests.cs (1)
43var options = new ImageGenerationOptions();
Microsoft.Extensions.AI.Integration.Tests (8)
ImageGeneratingChatClientIntegrationTests.cs (3)
328var imageGenerationOptions = new ImageGenerationOptions 409public List<(ImageGenerationRequest request, ImageGenerationOptions? options)> GenerateCalls { get; } = []; 412public Task<ImageGenerationResponse> GenerateAsync(ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default)
ImageGeneratorIntegrationTests.cs (3)
36var options = new ImageGenerationOptions 69var options = new ImageGenerationOptions 97var options = new ImageGenerationOptions
parent\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)
42public async Task<ImageGenerationResponse> GenerateAsync(ImageGenerationRequest request, ImageGenerationOptions? options = null, CancellationToken cancellationToken = default) 157/// <summary>Converts a <see cref="ImageGenerationOptions"/> to a <see cref="OpenAI.Images.ImageGenerationOptions"/>.</summary> 158private OpenAI.Images.ImageGenerationOptions ToOpenAIImageGenerationOptions(ImageGenerationOptions? options) 190/// <summary>Converts a <see cref="ImageGenerationOptions"/> to a <see cref="ImageEditOptions"/>.</summary> 191private ImageEditOptions ToOpenAIImageEditOptions(ImageGenerationOptions? options)
OpenAIResponsesChatClient.cs (1)
768ImageGenerationOptions? igo = imageGenerationTool.Options;
Microsoft.Extensions.AI.Stabilization.Tests (15)
parent\Microsoft.Extensions.AI.Abstractions.Tests\Image\ImageGenerationOptionsTests.cs (14)
16ImageGenerationOptions options = new(); 24ImageGenerationOptions clone = options.Clone(); 36ImageGenerationOptions options = new(); 56ImageGenerationOptions clone = options.Clone(); 68ImageGenerationOptions options = new() 79ImageGenerationOptions? deserialized = JsonSerializer.Deserialize<ImageGenerationOptions>(json, AIJsonUtilities.DefaultOptions); 92ImageGenerationOptions original = new() 101ImageGenerationOptions clone = original.Clone(); 150ImageGenerationOptions clone = b.Clone(); 171public override ImageGenerationOptions Clone() => new OptionsA(this); 188public override ImageGenerationOptions Clone() => new OptionsB(this); 226ImageGenerationOptions? result = JsonSerializer.Deserialize<ImageGenerationOptions>(Json, AIJsonUtilities.DefaultOptions);
parent\Microsoft.Extensions.AI.Abstractions.Tests\Tools\HostedImageGenerationToolTests.cs (1)
43var options = new ImageGenerationOptions();
Microsoft.Extensions.AI.Tests (5)
Image\ConfigureOptionsImageGeneratorTests.cs (2)
33ImageGenerationOptions? providedOptions = nullProvidedOptions ? null : new() { ModelId = "test" }; 34ImageGenerationOptions? returnedOptions = null;
Image\OpenTelemetryImageGeneratorTests.cs (1)
79ImageGenerationOptions options = new()
parent\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)