diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureAIOpenAIModelFactory.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureAIOpenAIModelFactory.cs
index c6eac9b606a1..2f70dfcd905b 100644
--- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureAIOpenAIModelFactory.cs
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureAIOpenAIModelFactory.cs
@@ -8,6 +8,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using Azure;
namespace Azure.AI.OpenAI
{
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIOperationState.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIOperationState.cs
new file mode 100644
index 000000000000..69d6772dfc5d
--- /dev/null
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIOperationState.cs
@@ -0,0 +1,60 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.AI.OpenAI
+{
+ /// The state of a job or item.
+ internal readonly partial struct AzureOpenAIOperationState : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public AzureOpenAIOperationState(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string NotRunningValue = "notRunning";
+ private const string RunningValue = "running";
+ private const string SucceededValue = "succeeded";
+ private const string CanceledValue = "canceled";
+ private const string FailedValue = "failed";
+
+ /// The operation was created and is queued to be processed in the future.
+ public static AzureOpenAIOperationState NotRunning { get; } = new AzureOpenAIOperationState(NotRunningValue);
+ /// The operation has started to be processed.
+ public static AzureOpenAIOperationState Running { get; } = new AzureOpenAIOperationState(RunningValue);
+ /// The operation has successfully be processed and is ready for consumption.
+ public static AzureOpenAIOperationState Succeeded { get; } = new AzureOpenAIOperationState(SucceededValue);
+ /// The operation has been canceled and is incomplete.
+ public static AzureOpenAIOperationState Canceled { get; } = new AzureOpenAIOperationState(CanceledValue);
+ /// The operation has completed processing with a failure and cannot be further consumed.
+ public static AzureOpenAIOperationState Failed { get; } = new AzureOpenAIOperationState(FailedValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(AzureOpenAIOperationState left, AzureOpenAIOperationState right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(AzureOpenAIOperationState left, AzureOpenAIOperationState right) => !left.Equals(right);
+ /// Converts a string to a .
+ public static implicit operator AzureOpenAIOperationState(string value) => new AzureOpenAIOperationState(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is AzureOpenAIOperationState other && Equals(other);
+ ///
+ public bool Equals(AzureOpenAIOperationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value?.GetHashCode() ?? 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchImageGenerationOperationResponse.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchImageGenerationOperationResponse.Serialization.cs
new file mode 100644
index 000000000000..b00357bf1902
--- /dev/null
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchImageGenerationOperationResponse.Serialization.cs
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure;
+using Azure.Core;
+
+namespace Azure.AI.OpenAI
+{
+ internal partial class BatchImageGenerationOperationResponse
+ {
+ internal static BatchImageGenerationOperationResponse DeserializeBatchImageGenerationOperationResponse(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string id = default;
+ long created = default;
+ Optional expires = default;
+ Optional result = default;
+ AzureOpenAIOperationState status = default;
+ Optional error = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("id"u8))
+ {
+ id = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("created"u8))
+ {
+ created = property.Value.GetInt64();
+ continue;
+ }
+ if (property.NameEquals("expires"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ expires = property.Value.GetInt64();
+ continue;
+ }
+ if (property.NameEquals("result"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ result = ImageGenerations.DeserializeImageGenerations(property.Value);
+ continue;
+ }
+ if (property.NameEquals("status"u8))
+ {
+ status = new AzureOpenAIOperationState(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("error"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ error = JsonSerializer.Deserialize(property.Value.GetRawText());
+ continue;
+ }
+ }
+ return new BatchImageGenerationOperationResponse(id, created, Optional.ToNullable(expires), result.Value, status, error.Value);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static BatchImageGenerationOperationResponse FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeBatchImageGenerationOperationResponse(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchImageGenerationOperationResponse.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchImageGenerationOperationResponse.cs
new file mode 100644
index 000000000000..03ab2390ca12
--- /dev/null
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/BatchImageGenerationOperationResponse.cs
@@ -0,0 +1,61 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure;
+using Azure.Core;
+
+namespace Azure.AI.OpenAI
+{
+ /// A polling status update or final response payload for an image operation.
+ internal partial class BatchImageGenerationOperationResponse
+ {
+ /// Initializes a new instance of BatchImageGenerationOperationResponse.
+ /// The ID of the operation.
+ /// A timestamp when this job or item was created (in unix epochs).
+ /// The status of the operation.
+ /// is null.
+ internal BatchImageGenerationOperationResponse(string id, long created, AzureOpenAIOperationState status)
+ {
+ Argument.AssertNotNull(id, nameof(id));
+
+ Id = id;
+ Created = created;
+ Status = status;
+ }
+
+ /// Initializes a new instance of BatchImageGenerationOperationResponse.
+ /// The ID of the operation.
+ /// A timestamp when this job or item was created (in unix epochs).
+ /// A timestamp when this operation and its associated images expire and will be deleted (in unix epochs).
+ /// The result of the operation if the operation succeeded.
+ /// The status of the operation.
+ /// The error if the operation failed.
+ internal BatchImageGenerationOperationResponse(string id, long created, long? expires, ImageGenerations result, AzureOpenAIOperationState status, ResponseError error)
+ {
+ Id = id;
+ Created = created;
+ Expires = expires;
+ Result = result;
+ Status = status;
+ Error = error;
+ }
+
+ /// The ID of the operation.
+ public string Id { get; }
+ /// A timestamp when this job or item was created (in unix epochs).
+ public long Created { get; }
+ /// A timestamp when this operation and its associated images expire and will be deleted (in unix epochs).
+ public long? Expires { get; }
+ /// The result of the operation if the operation succeeded.
+ public ImageGenerations Result { get; }
+ /// The status of the operation.
+ public AzureOpenAIOperationState Status { get; }
+ /// The error if the operation failed.
+ public ResponseError Error { get; }
+ }
+}
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Docs/OpenAIClient.xml b/sdk/openai/Azure.AI.OpenAI/src/Generated/Docs/OpenAIClient.xml
index a98717f007b7..435112a6fe77 100644
--- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Docs/OpenAIClient.xml
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Docs/OpenAIClient.xml
@@ -167,5 +167,13 @@ var result = client.GetChatCompletions("", chatCompletionsOptions)
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.Serialization.cs
new file mode 100644
index 000000000000..2211d79917bf
--- /dev/null
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.Serialization.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.OpenAI
+{
+ internal partial class ImageGenerationOptions : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("prompt"u8);
+ writer.WriteStringValue(Prompt);
+ if (Optional.IsDefined(ImageCount))
+ {
+ writer.WritePropertyName("n"u8);
+ writer.WriteNumberValue(ImageCount.Value);
+ }
+ if (Optional.IsDefined(Size))
+ {
+ writer.WritePropertyName("size"u8);
+ writer.WriteStringValue(Size.Value.ToString());
+ }
+ if (Optional.IsDefined(ResponseFormat))
+ {
+ writer.WritePropertyName("response_format"u8);
+ writer.WriteStringValue(ResponseFormat.Value.ToString());
+ }
+ if (Optional.IsDefined(User))
+ {
+ writer.WritePropertyName("user"u8);
+ writer.WriteStringValue(User);
+ }
+ writer.WriteEndObject();
+ }
+
+ /// Convert into a Utf8JsonRequestContent.
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.cs
new file mode 100644
index 000000000000..61616d1e60fb
--- /dev/null
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationOptions.cs
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+
+namespace Azure.AI.OpenAI
+{
+ /// Represents the request data used to generate images.
+ internal partial class ImageGenerationOptions
+ {
+ /// Initializes a new instance of ImageGenerationOptions.
+ /// A description of the desired images.
+ /// is null.
+ public ImageGenerationOptions(string prompt)
+ {
+ Argument.AssertNotNull(prompt, nameof(prompt));
+
+ Prompt = prompt;
+ }
+
+ /// Initializes a new instance of ImageGenerationOptions.
+ /// A description of the desired images.
+ /// The number of images to generate (defaults to 1).
+ /// The desired size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 (defaults to 1024x1024).
+ ///
+ /// The format in which image generation response items should be presented.
+ /// Azure OpenAI only supports URL response items.
+ ///
+ /// A unique identifier representing your end-user, which can help to monitor and detect abuse.
+ internal ImageGenerationOptions(string prompt, int? imageCount, ImageSize? size, ImageGenerationResponseFormat? responseFormat, string user)
+ {
+ Prompt = prompt;
+ ImageCount = imageCount;
+ Size = size;
+ ResponseFormat = responseFormat;
+ User = user;
+ }
+
+ /// A description of the desired images.
+ public string Prompt { get; }
+ /// The number of images to generate (defaults to 1).
+ public int? ImageCount { get; set; }
+ /// The desired size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 (defaults to 1024x1024).
+ public ImageSize? Size { get; set; }
+ ///
+ /// The format in which image generation response items should be presented.
+ /// Azure OpenAI only supports URL response items.
+ ///
+ public ImageGenerationResponseFormat? ResponseFormat { get; set; }
+ /// A unique identifier representing your end-user, which can help to monitor and detect abuse.
+ public string User { get; set; }
+ }
+}
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationResponseFormat.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationResponseFormat.cs
new file mode 100644
index 000000000000..ce53e220d177
--- /dev/null
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerationResponseFormat.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.AI.OpenAI
+{
+ /// The format in which the generated images are returned.
+ internal readonly partial struct ImageGenerationResponseFormat : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public ImageGenerationResponseFormat(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string UrlValue = "url";
+ private const string Base64Value = "b64_json";
+
+ /// Image generation response items should provide a URL from which the image may be retrieved.
+ public static ImageGenerationResponseFormat Url { get; } = new ImageGenerationResponseFormat(UrlValue);
+ /// Image generation response items should provide image data as a base64-encoded string.
+ public static ImageGenerationResponseFormat Base64 { get; } = new ImageGenerationResponseFormat(Base64Value);
+ /// Determines if two values are the same.
+ public static bool operator ==(ImageGenerationResponseFormat left, ImageGenerationResponseFormat right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(ImageGenerationResponseFormat left, ImageGenerationResponseFormat right) => !left.Equals(right);
+ /// Converts a string to a .
+ public static implicit operator ImageGenerationResponseFormat(string value) => new ImageGenerationResponseFormat(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is ImageGenerationResponseFormat other && Equals(other);
+ ///
+ public bool Equals(ImageGenerationResponseFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value?.GetHashCode() ?? 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.Serialization.cs
new file mode 100644
index 000000000000..f2656fbded4b
--- /dev/null
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.Serialization.cs
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure;
+using Azure.Core;
+
+namespace Azure.AI.OpenAI
+{
+ internal partial class ImageGenerations
+ {
+ internal static ImageGenerations DeserializeImageGenerations(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ long created = default;
+ IReadOnlyList data = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("created"u8))
+ {
+ created = property.Value.GetInt64();
+ continue;
+ }
+ if (property.NameEquals("data"u8))
+ {
+ data = property.Value.();
+ continue;
+ }
+ }
+ return new ImageGenerations(created, data);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ImageGenerations FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeImageGenerations(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.cs
new file mode 100644
index 000000000000..6c9206b3df50
--- /dev/null
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageGenerations.cs
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Azure.Core;
+
+namespace Azure.AI.OpenAI
+{
+ /// The result of the operation if the operation succeeded.
+ internal partial class ImageGenerations
+ {
+ /// Initializes a new instance of ImageGenerations.
+ /// A timestamp when this job or item was created (in unix epochs).
+ /// The images generated by the operator.
+ /// is null.
+ internal ImageGenerations(long internalCreatedSecondsAfterUnixEpoch, IEnumerable internalEmittedImageResponseItems)
+ {
+ Argument.AssertNotNull(internalEmittedImageResponseItems, nameof(internalEmittedImageResponseItems));
+
+ InternalCreatedSecondsAfterUnixEpoch = internalCreatedSecondsAfterUnixEpoch;
+ InternalEmittedImageResponseItems = internalEmittedImageResponseItems.ToList();
+ }
+
+ /// Initializes a new instance of ImageGenerations.
+ /// A timestamp when this job or item was created (in unix epochs).
+ /// The images generated by the operator.
+ internal ImageGenerations(long internalCreatedSecondsAfterUnixEpoch, IReadOnlyList internalEmittedImageResponseItems)
+ {
+ InternalCreatedSecondsAfterUnixEpoch = internalCreatedSecondsAfterUnixEpoch;
+ InternalEmittedImageResponseItems = internalEmittedImageResponseItems;
+ }
+
+ /// A timestamp when this job or item was created (in unix epochs).
+ public long InternalCreatedSecondsAfterUnixEpoch { get; }
+ /// The images generated by the operator.
+ public IReadOnlyList InternalEmittedImageResponseItems { get; }
+ }
+}
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageLocation.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageLocation.Serialization.cs
new file mode 100644
index 000000000000..e53498326e0e
--- /dev/null
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageLocation.Serialization.cs
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using Azure;
+using Azure.Core;
+
+namespace Azure.AI.OpenAI
+{
+ internal partial class ImageLocation
+ {
+ internal static ImageLocation DeserializeImageLocation(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ Uri url = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("url"u8))
+ {
+ url = new Uri(property.Value.GetString());
+ continue;
+ }
+ }
+ return new ImageLocation(url);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ImageLocation FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeImageLocation(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageLocation.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageLocation.cs
new file mode 100644
index 000000000000..37f4e9371827
--- /dev/null
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageLocation.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+
+namespace Azure.AI.OpenAI
+{
+ /// An image response item that provides a URL from which an image may be accessed.
+ internal partial class ImageLocation
+ {
+ /// Initializes a new instance of ImageLocation.
+ /// The URL that provides temporary access to download the generated image.
+ /// is null.
+ internal ImageLocation(Uri url)
+ {
+ Argument.AssertNotNull(url, nameof(url));
+
+ Url = url;
+ }
+
+ /// The URL that provides temporary access to download the generated image.
+ public Uri Url { get; }
+ }
+}
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageSize.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageSize.cs
new file mode 100644
index 000000000000..22bded6ea1ab
--- /dev/null
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageSize.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.AI.OpenAI
+{
+ /// The desired size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
+ internal readonly partial struct ImageSize : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public ImageSize(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string Size256x256Value = "256x256";
+ private const string Size512x512Value = "512x512";
+ private const string Size1024x1024Value = "1024x1024";
+
+ /// Image size of 256x256.
+ public static ImageSize Size256x256 { get; } = new ImageSize(Size256x256Value);
+ /// Image size of 512x512.
+ public static ImageSize Size512x512 { get; } = new ImageSize(Size512x512Value);
+ /// Image size of 1024x1024.
+ public static ImageSize Size1024x1024 { get; } = new ImageSize(Size1024x1024Value);
+ /// Determines if two values are the same.
+ public static bool operator ==(ImageSize left, ImageSize right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(ImageSize left, ImageSize right) => !left.Equals(right);
+ /// Converts a string to a .
+ public static implicit operator ImageSize(string value) => new ImageSize(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is ImageSize other && Equals(other);
+ ///
+ public bool Equals(ImageSize other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value?.GetHashCode() ?? 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs
index 075a6ef2d8da..ecc48833fdb0 100644
--- a/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs
@@ -37,6 +37,133 @@ protected OpenAIClient()
{
}
+ /// Starts the generation of a batch of images from a text caption.
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// Represents the request data used to generate images.
+ /// The cancellation token to use.
+ /// is null.
+ ///
+ internal virtual async Task> BeginAzureBatchImageGenerationAsync(WaitUntil waitUntil, ImageGenerationOptions imageGenerationOptions, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(imageGenerationOptions, nameof(imageGenerationOptions));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Operation response = await BeginAzureBatchImageGenerationAsync(waitUntil, imageGenerationOptions.ToRequestContent(), context).ConfigureAwait(false);
+ return ProtocolOperationHelpers.Convert(response, BatchImageGenerationOperationResponse.FromResponse, ClientDiagnostics, "OpenAIClient.BeginAzureBatchImageGeneration");
+ }
+
+ /// Starts the generation of a batch of images from a text caption.
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// Represents the request data used to generate images.
+ /// The cancellation token to use.
+ /// is null.
+ ///
+ internal virtual Operation BeginAzureBatchImageGeneration(WaitUntil waitUntil, ImageGenerationOptions imageGenerationOptions, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(imageGenerationOptions, nameof(imageGenerationOptions));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Operation response = BeginAzureBatchImageGeneration(waitUntil, imageGenerationOptions.ToRequestContent(), context);
+ return ProtocolOperationHelpers.Convert(response, BatchImageGenerationOperationResponse.FromResponse, ClientDiagnostics, "OpenAIClient.BeginAzureBatchImageGeneration");
+ }
+
+ ///
+ /// [Protocol Method] Starts the generation of a batch of images from a text caption
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// Service returned a non-success status code.
+ /// The representing an asynchronous operation on the service.
+ ///
+ internal virtual async Task> BeginAzureBatchImageGenerationAsync(WaitUntil waitUntil, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("OpenAIClient.BeginAzureBatchImageGeneration");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateBeginAzureBatchImageGenerationRequest(content, context);
+ return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "OpenAIClient.BeginAzureBatchImageGeneration", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Starts the generation of a batch of images from a text caption
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// Service returned a non-success status code.
+ /// The representing an asynchronous operation on the service.
+ ///
+ internal virtual Operation BeginAzureBatchImageGeneration(WaitUntil waitUntil, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("OpenAIClient.BeginAzureBatchImageGeneration");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateBeginAzureBatchImageGenerationRequest(content, context);
+ return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "OpenAIClient.BeginAzureBatchImageGeneration", OperationFinalStateVia.Location, context, waitUntil);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ internal HttpMessage CreateBeginAzureBatchImageGenerationRequest(RequestContent content, RequestContext context)
+ {
+ var message = _pipeline.CreateMessage(context, ResponseClassifier202);
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendRaw("/openai", false);
+ uri.AppendPath("/images/generations:submit", false);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ request.Headers.Add("Content-Type", "application/json");
+ request.Content = content;
+ return message;
+ }
+
private static RequestContext DefaultRequestContext = new RequestContext();
internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default)
{
@@ -50,5 +177,7 @@ internal static RequestContext FromCancellationToken(CancellationToken cancellat
private static ResponseClassifier _responseClassifier200;
private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 });
+ private static ResponseClassifier _responseClassifier202;
+ private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 });
}
}
diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClientOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClientOptions.cs
index 738e64701d54..451fe6345eac 100644
--- a/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClientOptions.cs
+++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClientOptions.cs
@@ -13,15 +13,17 @@ namespace Azure.AI.OpenAI
/// Client options for OpenAIClient.
public partial class OpenAIClientOptions : ClientOptions
{
- private const ServiceVersion LatestVersion = ServiceVersion.V2023_03_15_Preview;
+ private const ServiceVersion LatestVersion = ServiceVersion.V2023_06_01_Preview;
/// The version of the service to use.
public enum ServiceVersion
{
/// Service version "2022-12-01".
V2022_12_01 = 1,
- /// Service version "2023-03-15-preview".
- V2023_03_15_Preview = 2,
+ /// Service version "2023-05-15".
+ V2023_05_15 = 2,
+ /// Service version "2023-06-01-preview".
+ V2023_06_01_Preview = 3,
}
internal string Version { get; }
@@ -32,7 +34,8 @@ public OpenAIClientOptions(ServiceVersion version = LatestVersion)
Version = version switch
{
ServiceVersion.V2022_12_01 => "2022-12-01",
- ServiceVersion.V2023_03_15_Preview => "2023-03-15-preview",
+ ServiceVersion.V2023_05_15 => "2023-05-15",
+ ServiceVersion.V2023_06_01_Preview => "2023-06-01-preview",
_ => throw new NotSupportedException()
};
}
diff --git a/sdk/openai/Azure.AI.OpenAI/tsp-location.yaml b/sdk/openai/Azure.AI.OpenAI/tsp-location.yaml
index 92ca017d7149..daf8305157de 100644
--- a/sdk/openai/Azure.AI.OpenAI/tsp-location.yaml
+++ b/sdk/openai/Azure.AI.OpenAI/tsp-location.yaml
@@ -1,3 +1,5 @@
+commit: 61c7c5426050ec3b2ddb5ed8f732a75d3f1cd588
directory: specification/cognitiveservices/OpenAI.Inference
-commit: 6af0ff9b1a10e4d498699eab53cc1e6b797bda8c
+additionalDirectories: []
repo: Azure/azure-rest-api-specs
+