diff --git a/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs b/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs index 3a5d6e5c456c..87ab96701e86 100644 --- a/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs +++ b/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs @@ -90,7 +90,7 @@ public static partial class AzureOpenAIModelFactory public static Azure.AI.OpenAI.CompletionsLogProbabilityModel CompletionsLogProbabilityModel(System.Collections.Generic.IEnumerable tokens = null, System.Collections.Generic.IEnumerable tokenLogProbabilities = null, System.Collections.Generic.IEnumerable> topLogProbabilities = null, System.Collections.Generic.IEnumerable textOffsets = null) { throw null; } public static Azure.AI.OpenAI.CompletionsUsage CompletionsUsage(int completionTokens = 0, int promptTokens = 0, int totalTokens = 0) { throw null; } public static Azure.AI.OpenAI.ContentFilterResult ContentFilterResult(Azure.AI.OpenAI.ContentFilterSeverity severity = default(Azure.AI.OpenAI.ContentFilterSeverity), bool filtered = false) { throw null; } - public static Azure.AI.OpenAI.ContentFilterResults ContentFilterResults(Azure.AI.OpenAI.ContentFilterResult sexual = null, Azure.AI.OpenAI.ContentFilterResult violence = null, Azure.AI.OpenAI.ContentFilterResult hate = null, Azure.AI.OpenAI.ContentFilterResult selfHarm = null) { throw null; } + public static Azure.AI.OpenAI.ContentFilterResults ContentFilterResults(Azure.AI.OpenAI.ContentFilterResult sexual = null, Azure.AI.OpenAI.ContentFilterResult violence = null, Azure.AI.OpenAI.ContentFilterResult hate = null, Azure.AI.OpenAI.ContentFilterResult selfHarm = null, Azure.ResponseError error = null) { throw null; } public static Azure.AI.OpenAI.EmbeddingItem EmbeddingItem(System.Collections.Generic.IEnumerable embedding = null, int index = 0) { throw null; } public static Azure.AI.OpenAI.Embeddings Embeddings(System.Collections.Generic.IEnumerable data = null, Azure.AI.OpenAI.EmbeddingsUsage usage = null) { throw null; } public static Azure.AI.OpenAI.EmbeddingsUsage EmbeddingsUsage(int promptTokens = 0, int totalTokens = 0) { throw null; } @@ -248,6 +248,7 @@ internal ContentFilterResult() { } public partial class ContentFilterResults { internal ContentFilterResults() { } + public Azure.ResponseError Error { get { throw null; } } public Azure.AI.OpenAI.ContentFilterResult Hate { get { throw null; } } public Azure.AI.OpenAI.ContentFilterResult SelfHarm { get { throw null; } } public Azure.AI.OpenAI.ContentFilterResult Sexual { get { throw null; } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIModelFactory.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIModelFactory.cs index 8f507b54d557..2e1b5819201a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIModelFactory.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIModelFactory.cs @@ -105,10 +105,14 @@ public static PromptFilterResult PromptFilterResult(int promptIndex = default, C /// Describes language related to physical actions intended to purposely hurt, injure, /// or damage one’s body, or kill oneself. /// + /// + /// Describes an error returned if the content filtering system is + /// down or otherwise unable to complete the operation in time. + /// /// A new instance for mocking. - public static ContentFilterResults ContentFilterResults(ContentFilterResult sexual = null, ContentFilterResult violence = null, ContentFilterResult hate = null, ContentFilterResult selfHarm = null) + public static ContentFilterResults ContentFilterResults(ContentFilterResult sexual = null, ContentFilterResult violence = null, ContentFilterResult hate = null, ContentFilterResult selfHarm = null, ResponseError error = null) { - return new ContentFilterResults(sexual, violence, hate, selfHarm); + return new ContentFilterResults(sexual, violence, hate, selfHarm, error); } /// Initializes a new instance of ContentFilterResult. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResults.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResults.Serialization.cs index 4e5b1cc62ad8..1a030b9cff66 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResults.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResults.Serialization.cs @@ -23,6 +23,7 @@ internal static ContentFilterResults DeserializeContentFilterResults(JsonElement Optional violence = default; Optional hate = default; Optional selfHarm = default; + Optional error = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sexual"u8)) @@ -61,8 +62,17 @@ internal static ContentFilterResults DeserializeContentFilterResults(JsonElement selfHarm = ContentFilterResult.DeserializeContentFilterResult(property.Value); continue; } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } } - return new ContentFilterResults(sexual.Value, violence.Value, hate.Value, selfHarm.Value); + return new ContentFilterResults(sexual.Value, violence.Value, hate.Value, selfHarm.Value, error.Value); } /// Deserializes the model from a raw response. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResults.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResults.cs index 1132a5df81df..bdb621d2b261 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResults.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResults.cs @@ -5,6 +5,8 @@ #nullable disable +using Azure; + namespace Azure.AI.OpenAI { /// Information about the content filtering category, if it has been detected. @@ -37,12 +39,17 @@ internal ContentFilterResults() /// Describes language related to physical actions intended to purposely hurt, injure, /// or damage one’s body, or kill oneself. /// - internal ContentFilterResults(ContentFilterResult sexual, ContentFilterResult violence, ContentFilterResult hate, ContentFilterResult selfHarm) + /// + /// Describes an error returned if the content filtering system is + /// down or otherwise unable to complete the operation in time. + /// + internal ContentFilterResults(ContentFilterResult sexual, ContentFilterResult violence, ContentFilterResult hate, ContentFilterResult selfHarm, ResponseError error) { Sexual = sexual; Violence = violence; Hate = hate; SelfHarm = selfHarm; + Error = error; } /// @@ -70,5 +77,10 @@ internal ContentFilterResults(ContentFilterResult sexual, ContentFilterResult vi /// or damage one’s body, or kill oneself. /// public ContentFilterResult SelfHarm { get; } + /// + /// Describes an error returned if the content filtering system is + /// down or otherwise unable to complete the operation in time. + /// + public ResponseError Error { get; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/tsp-location.yaml b/sdk/openai/Azure.AI.OpenAI/tsp-location.yaml index 2246c7155e2f..98e9f5130d6e 100644 --- a/sdk/openai/Azure.AI.OpenAI/tsp-location.yaml +++ b/sdk/openai/Azure.AI.OpenAI/tsp-location.yaml @@ -1,3 +1,5 @@ -directory: specification/cognitiveservices/OpenAI.Inference -commit: b646a42aa3b7a0ce488d05f1724827ea41d12cf1 +additionalDirectories: [] repo: Azure/azure-rest-api-specs +commit: b7b2ee92e149ce85cba13596e28402d4196fe4ae +directory: specification/cognitiveservices/OpenAI.Inference +