diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsClientOptions.cs
index d44da9f8c426..a028b7d1ca96 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsClientOptions.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsClientOptions.cs
@@ -13,7 +13,7 @@ namespace Azure.AI.Language.Conversations
/// Client options for ConversationAnalysisClient.
public partial class ConversationsClientOptions : ClientOptions
{
- private const ServiceVersion LatestVersion = ServiceVersion.V2024_11_15_Preview;
+ private const ServiceVersion LatestVersion = ServiceVersion.V2025_05_15_Preview;
/// The version of the service to use.
public enum ServiceVersion
@@ -28,6 +28,8 @@ public enum ServiceVersion
V2024_11_01 = 4,
/// Service version "2024-11-15-preview".
V2024_11_15_Preview = 5,
+ /// Service version "2025-05-15-preview".
+ V2025_05_15_Preview = 6,
}
internal string Version { get; }
@@ -42,6 +44,7 @@ public ConversationsClientOptions(ServiceVersion version = LatestVersion)
ServiceVersion.V2024_05_01 => "2024-05-01",
ServiceVersion.V2024_11_01 => "2024-11-01",
ServiceVersion.V2024_11_15_Preview => "2024-11-15-preview",
+ ServiceVersion.V2025_05_15_Preview => "2025-05-15-preview",
_ => throw new NotSupportedException()
};
}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsModelFactory.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsModelFactory.cs
index 969afa1b41ec..90d973882f63 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsModelFactory.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsModelFactory.cs
@@ -15,6 +15,25 @@ namespace Azure.AI.Language.Conversations
/// Model factory for models.
public static partial class ConversationsModelFactory
{
+ /// Initializes a new instance of .
+ /// The input ConversationItem and its optional parameters.
+ /// Input parameters necessary for a Conversation language understanding task.
+ /// A new instance for mocking.
+ public static ConversationalAITask ConversationalAITask(ConversationalAIAnalysisInput analysisInput = null, ConversationalAIInputParameters parameters = null)
+ {
+ return new ConversationalAITask(AnalyzeConversationInputKind.ConversationalAI, serializedAdditionalRawData: null, analysisInput, parameters);
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the project to use.
+ /// The name of the deployment to use.
+ /// Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets.
+ /// A new instance for mocking.
+ public static ConversationalAIInputParameters ConversationalAIInputParameters(string projectName = null, string deploymentName = null, StringIndexType? stringIndexType = null)
+ {
+ return new ConversationalAIInputParameters(projectName, deploymentName, stringIndexType, serializedAdditionalRawData: null);
+ }
+
/// Initializes a new instance of .
/// The input ConversationItem and its optional parameters.
/// Input parameters necessary for a Conversation language understanding task.
@@ -81,87 +100,94 @@ public static KnowledgeBaseAnswerContext KnowledgeBaseAnswerContext(int previous
return new KnowledgeBaseAnswerContext(previousQnaId, previousQuestion, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// Represents a conversation analysis response.
- /// A new instance for mocking.
- public static ConversationActionResult ConversationActionResult(AnalyzeConversationResult result = null)
+ /// Initializes a new instance of .
+ /// Represents the conversational analysis response.
+ /// A new instance for mocking.
+ public static ConversationalAITaskResult ConversationalAITaskResult(ConversationalAIResult result = null)
{
- return new ConversationActionResult(AnalyzeConversationResultKind.ConversationResult, serializedAdditionalRawData: null, result);
+ return new ConversationalAITaskResult(AnalyzeConversationResultKind.ConversationalAIResult, serializedAdditionalRawData: null, result);
}
- /// Initializes a new instance of .
- /// The conversation utterance given by the caller.
- /// The system detected language for the query in BCP 47 language representation..
- ///
- /// The prediction result of a conversation project.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include and .
- ///
- /// A new instance for mocking.
- public static AnalyzeConversationResult AnalyzeConversationResult(string query = null, string detectedLanguage = null, PredictionBase prediction = null)
+ /// Initializes a new instance of .
+ /// Multiple multi-turn conversations analyzed.
+ /// Any warnings encountered during processing.
+ /// A new instance for mocking.
+ public static ConversationalAIResult ConversationalAIResult(IEnumerable conversations = null, IEnumerable warnings = null)
{
- return new AnalyzeConversationResult(query, detectedLanguage, prediction, serializedAdditionalRawData: null);
+ conversations ??= new List();
+ warnings ??= new List();
+
+ return new ConversationalAIResult(conversations?.ToList(), warnings?.ToList(), serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The type of the project.
- /// The intent with the highest score.
- /// A new instance for mocking.
- public static PredictionBase PredictionBase(string projectKind = null, string topIntent = null)
+ /// Initializes a new instance of .
+ /// The ID of the conversation.
+ /// The intent classification results for this conversation.
+ /// Global entities that are matched but not associated with any specific intent.
+ /// A new instance for mocking.
+ public static ConversationalAIAnalysis ConversationalAIAnalysis(string id = null, IEnumerable intents = null, IEnumerable entities = null)
{
- return new UnknownPredictionBase(projectKind == null ? default : new ProjectKind(projectKind), topIntent, serializedAdditionalRawData: null);
+ intents ??= new List();
+ entities ??= new List();
+
+ return new ConversationalAIAnalysis(id, intents?.ToList(), entities?.ToList(), serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The intent with the highest score.
- /// The intent classification results.
- /// The entity extraction results.
- /// A new instance for mocking.
- public static ConversationPrediction ConversationPrediction(string topIntent = null, IEnumerable intents = null, IEnumerable entities = null)
+ /// Initializes a new instance of .
+ /// The name of the detected intent.
+ /// The type of intent, either "action" or "question".
+ /// The ranges of conversation items where this intent was identified.
+ /// The entities associated with this intent.
+ /// A new instance for mocking.
+ public static ConversationalAIIntent ConversationalAIIntent(string name = null, string type = null, IEnumerable conversationItemRanges = null, IEnumerable entities = null)
{
- intents ??= new List();
- entities ??= new List();
+ conversationItemRanges ??= new List();
+ entities ??= new List();
- return new ConversationPrediction(ProjectKind.Conversation, topIntent, serializedAdditionalRawData: null, intents?.ToList(), entities?.ToList());
+ return new ConversationalAIIntent(name, type, conversationItemRanges?.ToList(), entities?.ToList(), serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// A predicted class.
- /// The confidence score of the class from 0.0 to 1.0.
- /// A new instance for mocking.
- public static ConversationIntent ConversationIntent(string category = null, float confidence = default)
+ /// Initializes a new instance of .
+ /// The starting index of the intent occurrence within the conversation.
+ /// The number of continuous conversation items for this intent.
+ /// A new instance for mocking.
+ public static ConversationItemRange ConversationItemRange(int offset = default, int count = default)
{
- return new ConversationIntent(category, confidence, serializedAdditionalRawData: null);
+ return new ConversationItemRange(offset, count, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The entity category.
- /// The predicted entity text.
- /// The starting index of this entity in the query.
- /// The length of the text.
- /// The entity confidence score.
+ /// Initializes a new instance of .
+ /// The entity name or category.
+ /// The detected text of the entity.
+ /// The confidence score of the entity detection (0.0 to 1.0).
+ /// The starting index of the entity in the query.
+ /// The length of the detected entity text.
+ /// The ID of the conversation item where the entity appears.
+ /// The index of the conversation item where the entity appears.
///
- /// The collection of entity resolution objects.
+ /// Entity resolution details, if available.
/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
/// The available derived classes include , , , , , , , , , , , , , and .
///
///
- /// The collection of entity extra information objects.
+ /// Additional entity metadata.
/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
/// The available derived classes include , and .
///
- /// A new instance for mocking.
- public static ConversationEntity ConversationEntity(string category = null, string text = null, int offset = default, int length = default, float confidence = default, IEnumerable resolutions = null, IEnumerable extraInformation = null)
+ /// A new instance for mocking.
+ public static ConversationalAIEntity ConversationalAIEntity(string name = null, string text = null, float confidenceScore = default, int offset = default, int length = default, string conversationItemId = null, int? conversationItemIndex = null, IEnumerable resolutions = null, IEnumerable extraInformation = null)
{
resolutions ??= new List();
extraInformation ??= new List();
- return new ConversationEntity(
- category,
+ return new ConversationalAIEntity(
+ name,
text,
+ confidenceScore,
offset,
length,
- confidence,
+ conversationItemId,
+ conversationItemIndex,
resolutions?.ToList(),
extraInformation?.ToList(),
serializedAdditionalRawData: null);
@@ -359,6 +385,92 @@ public static RegexKey RegexKey(string key = null, string regexPattern = null)
return new RegexKey(ExtraInformationKind.RegexKey, serializedAdditionalRawData: null, key, regexPattern);
}
+ /// Initializes a new instance of .
+ /// Represents a conversation analysis response.
+ /// A new instance for mocking.
+ public static ConversationActionResult ConversationActionResult(AnalyzeConversationResult result = null)
+ {
+ return new ConversationActionResult(AnalyzeConversationResultKind.ConversationResult, serializedAdditionalRawData: null, result);
+ }
+
+ /// Initializes a new instance of .
+ /// The conversation utterance given by the caller.
+ /// The system detected language for the query in BCP 47 language representation..
+ ///
+ /// The prediction result of a conversation project.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include and .
+ ///
+ /// A new instance for mocking.
+ public static AnalyzeConversationResult AnalyzeConversationResult(string query = null, string detectedLanguage = null, PredictionBase prediction = null)
+ {
+ return new AnalyzeConversationResult(query, detectedLanguage, prediction, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The type of the project.
+ /// The intent with the highest score.
+ /// A new instance for mocking.
+ public static PredictionBase PredictionBase(string projectKind = null, string topIntent = null)
+ {
+ return new UnknownPredictionBase(projectKind == null ? default : new ProjectKind(projectKind), topIntent, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The intent with the highest score.
+ /// The intent classification results.
+ /// The entity extraction results.
+ /// A new instance for mocking.
+ public static ConversationPrediction ConversationPrediction(string topIntent = null, IEnumerable intents = null, IEnumerable entities = null)
+ {
+ intents ??= new List();
+ entities ??= new List();
+
+ return new ConversationPrediction(ProjectKind.Conversation, topIntent, serializedAdditionalRawData: null, intents?.ToList(), entities?.ToList());
+ }
+
+ /// Initializes a new instance of .
+ /// A predicted class.
+ /// The confidence score of the class from 0.0 to 1.0.
+ /// A new instance for mocking.
+ public static ConversationIntent ConversationIntent(string category = null, float confidence = default)
+ {
+ return new ConversationIntent(category, confidence, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The entity category.
+ /// The predicted entity text.
+ /// The starting index of this entity in the query.
+ /// The length of the text.
+ /// The entity confidence score.
+ ///
+ /// The collection of entity resolution objects.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include , , , , , , , , , , , , , and .
+ ///
+ ///
+ /// The collection of entity extra information objects.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include , and .
+ ///
+ /// A new instance for mocking.
+ public static ConversationEntity ConversationEntity(string category = null, string text = null, int offset = default, int length = default, float confidence = default, IEnumerable resolutions = null, IEnumerable extraInformation = null)
+ {
+ resolutions ??= new List();
+ extraInformation ??= new List();
+
+ return new ConversationEntity(
+ category,
+ text,
+ offset,
+ length,
+ confidence,
+ resolutions?.ToList(),
+ extraInformation?.ToList(),
+ serializedAdditionalRawData: null);
+ }
+
/// Initializes a new instance of .
/// The intent with the highest score.
///
@@ -903,12 +1015,13 @@ public static ConversationRequestStatistics ConversationRequestStatistics(int do
/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
/// The available derived classes include , and .
///
+ /// Optional duration in seconds after which the job will be canceled if not completed.
/// A new instance for mocking.
- public static AnalyzeConversationOperationInput AnalyzeConversationOperationInput(string displayName = null, MultiLanguageConversationInput conversationInput = null, IEnumerable actions = null)
+ public static AnalyzeConversationOperationInput AnalyzeConversationOperationInput(string displayName = null, MultiLanguageConversationInput conversationInput = null, IEnumerable actions = null, float? cancelAfter = null)
{
actions ??= new List();
- return new AnalyzeConversationOperationInput(displayName, conversationInput, actions?.ToList(), serializedAdditionalRawData: null);
+ return new AnalyzeConversationOperationInput(displayName, conversationInput, actions?.ToList(), cancelAfter, serializedAdditionalRawData: null);
}
/// Initializes a new instance of .
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Docs/ConversationAnalysisClient.xml b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Docs/ConversationAnalysisClient.xml
index d44a199b3ac6..f2c1ac0f98ec 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Docs/ConversationAnalysisClient.xml
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Docs/ConversationAnalysisClient.xml
@@ -9,6 +9,32 @@ Uri endpoint = new Uri("");
AzureKeyCredential credential = new AzureKeyCredential("");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
+AnalyzeConversationInput analyzeConversationInput = new ConversationalAITask(new ConversationalAIAnalysisInput(new AIConversation[]
+{
+ new AIConversation("order", InputModality.Text, "en", new ConversationalAIItem[]
+ {
+ new ConversationalAIItem("1", "user", "Hi!"),
+ new ConversationalAIItem("2", "bot", "Hello, how can I help you?"),
+ new ConversationalAIItem("3", "user", "I would like to book a flight from Paris to Berlin on Oct 10th."),
+ new ConversationalAIItem("4", "bot", "Do you have any airline preference?"),
+ new ConversationalAIItem("5", "user", "No."),
+ new ConversationalAIItem("6", "user", "I like New York and Boston."),
+ new ConversationalAIItem("7", "user", "Actualy, change the destination to New York."),
+ new ConversationalAIItem("8", "user", "Wait, I do not like the food in New York."),
+ new ConversationalAIItem("9", "user", "Ok, change the destination back to Berlin.")
+ })
+}), new ConversationalAIInputParameters("project1", "deployment1")
+{
+ StringIndexType = StringIndexType.Utf16CodeUnit,
+});
+Response response = await client.AnalyzeConversationAsync(analyzeConversationInput);
+]]>
+This sample shows how to call AnalyzeConversationAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
+
AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Book a flight to Seattle on Oct 10th")), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}")
{
StringIndexType = new StringIndexType("TextElement_V8"),
@@ -69,6 +95,32 @@ Uri endpoint = new Uri("");
AzureKeyCredential credential = new AzureKeyCredential("");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
+AnalyzeConversationInput analyzeConversationInput = new ConversationalAITask(new ConversationalAIAnalysisInput(new AIConversation[]
+{
+ new AIConversation("order", InputModality.Text, "en", new ConversationalAIItem[]
+ {
+ new ConversationalAIItem("1", "user", "Hi!"),
+ new ConversationalAIItem("2", "bot", "Hello, how can I help you?"),
+ new ConversationalAIItem("3", "user", "I would like to book a flight from Paris to Berlin on Oct 10th."),
+ new ConversationalAIItem("4", "bot", "Do you have any airline preference?"),
+ new ConversationalAIItem("5", "user", "No."),
+ new ConversationalAIItem("6", "user", "I like New York and Boston."),
+ new ConversationalAIItem("7", "user", "Actualy, change the destination to New York."),
+ new ConversationalAIItem("8", "user", "Wait, I do not like the food in New York."),
+ new ConversationalAIItem("9", "user", "Ok, change the destination back to Berlin.")
+ })
+}), new ConversationalAIInputParameters("project1", "deployment1")
+{
+ StringIndexType = StringIndexType.Utf16CodeUnit,
+});
+Response response = client.AnalyzeConversation(analyzeConversationInput);
+]]>
+This sample shows how to call AnalyzeConversation.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
+
AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Book a flight to Seattle on Oct 10th")), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}")
{
StringIndexType = new StringIndexType("TextElement_V8"),
@@ -129,6 +181,96 @@ Uri endpoint = new Uri("");
AzureKeyCredential credential = new AzureKeyCredential("");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
+using RequestContent content = RequestContent.Create(new
+{
+ kind = "ConversationalAI",
+ parameters = new
+ {
+ projectName = "project1",
+ deploymentName = "deployment1",
+ stringIndexType = "Utf16CodeUnit",
+ },
+ analysisInput = new
+ {
+ conversations = new object[]
+ {
+ new
+ {
+ id = "order",
+ language = "en",
+ modality = "text",
+ conversationItems = new object[]
+ {
+ new
+ {
+ participantId = "user",
+ id = "1",
+ text = "Hi!",
+ },
+ new
+ {
+ participantId = "bot",
+ id = "2",
+ text = "Hello, how can I help you?",
+ },
+ new
+ {
+ participantId = "user",
+ id = "3",
+ text = "I would like to book a flight from Paris to Berlin on Oct 10th.",
+ },
+ new
+ {
+ participantId = "bot",
+ id = "4",
+ text = "Do you have any airline preference?",
+ },
+ new
+ {
+ participantId = "user",
+ id = "5",
+ text = "No.",
+ },
+ new
+ {
+ participantId = "user",
+ id = "6",
+ text = "I like New York and Boston.",
+ },
+ new
+ {
+ participantId = "user",
+ id = "7",
+ text = "Actualy, change the destination to New York.",
+ },
+ new
+ {
+ participantId = "user",
+ id = "8",
+ text = "Wait, I do not like the food in New York.",
+ },
+ new
+ {
+ participantId = "user",
+ id = "9",
+ text = "Ok, change the destination back to Berlin.",
+ }
+ },
+ }
+ },
+ },
+});
+Response response = await client.AnalyzeConversationAsync(content);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("kind").ToString());
+]]>
+This sample shows how to call AnalyzeConversationAsync and parse the result.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
+
using RequestContent content = RequestContent.Create(new
{
kind = "Conversation",
@@ -243,6 +385,96 @@ Uri endpoint = new Uri("");
AzureKeyCredential credential = new AzureKeyCredential("");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
+using RequestContent content = RequestContent.Create(new
+{
+ kind = "ConversationalAI",
+ parameters = new
+ {
+ projectName = "project1",
+ deploymentName = "deployment1",
+ stringIndexType = "Utf16CodeUnit",
+ },
+ analysisInput = new
+ {
+ conversations = new object[]
+ {
+ new
+ {
+ id = "order",
+ language = "en",
+ modality = "text",
+ conversationItems = new object[]
+ {
+ new
+ {
+ participantId = "user",
+ id = "1",
+ text = "Hi!",
+ },
+ new
+ {
+ participantId = "bot",
+ id = "2",
+ text = "Hello, how can I help you?",
+ },
+ new
+ {
+ participantId = "user",
+ id = "3",
+ text = "I would like to book a flight from Paris to Berlin on Oct 10th.",
+ },
+ new
+ {
+ participantId = "bot",
+ id = "4",
+ text = "Do you have any airline preference?",
+ },
+ new
+ {
+ participantId = "user",
+ id = "5",
+ text = "No.",
+ },
+ new
+ {
+ participantId = "user",
+ id = "6",
+ text = "I like New York and Boston.",
+ },
+ new
+ {
+ participantId = "user",
+ id = "7",
+ text = "Actualy, change the destination to New York.",
+ },
+ new
+ {
+ participantId = "user",
+ id = "8",
+ text = "Wait, I do not like the food in New York.",
+ },
+ new
+ {
+ participantId = "user",
+ id = "9",
+ text = "Ok, change the destination back to Berlin.",
+ }
+ },
+ }
+ },
+ },
+});
+Response response = client.AnalyzeConversation(content);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("kind").ToString());
+]]>
+This sample shows how to call AnalyzeConversation and parse the result.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);
+
using RequestContent content = RequestContent.Create(new
{
kind = "Conversation",
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AIConversation.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AIConversation.Serialization.cs
new file mode 100644
index 000000000000..97d13e37c4c7
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AIConversation.Serialization.cs
@@ -0,0 +1,176 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ public partial class AIConversation : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AIConversation)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("id"u8);
+ writer.WriteStringValue(Id);
+ writer.WritePropertyName("modality"u8);
+ writer.WriteStringValue(Modality.ToString());
+ writer.WritePropertyName("language"u8);
+ writer.WriteStringValue(Language);
+ writer.WritePropertyName("conversationItems"u8);
+ writer.WriteStartArray();
+ foreach (var item in ConversationItems)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ AIConversation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AIConversation)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAIConversation(document.RootElement, options);
+ }
+
+ internal static AIConversation DeserializeAIConversation(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string id = default;
+ InputModality modality = default;
+ string language = default;
+ IList conversationItems = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("id"u8))
+ {
+ id = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("modality"u8))
+ {
+ modality = new InputModality(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("language"u8))
+ {
+ language = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("conversationItems"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(ConversationalAIItem.DeserializeConversationalAIItem(item, options));
+ }
+ conversationItems = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AIConversation(id, modality, language, conversationItems, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(AIConversation)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AIConversation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAIConversation(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AIConversation)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static AIConversation FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAIConversation(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AIConversation.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AIConversation.cs
new file mode 100644
index 000000000000..ace9cfdce0d6
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AIConversation.cs
@@ -0,0 +1,96 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ /// The Conversations for ai conversation analysis.
+ public partial class AIConversation
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The ID of the conversation.
+ /// Default modality for all conversation items.
+ /// Default language for all conversation items in BCP 47 language representation.
+ /// List of conversation items.
+ /// , or is null.
+ public AIConversation(string id, InputModality modality, string language, IEnumerable conversationItems)
+ {
+ Argument.AssertNotNull(id, nameof(id));
+ Argument.AssertNotNull(language, nameof(language));
+ Argument.AssertNotNull(conversationItems, nameof(conversationItems));
+
+ Id = id;
+ Modality = modality;
+ Language = language;
+ ConversationItems = conversationItems.ToList();
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the conversation.
+ /// Default modality for all conversation items.
+ /// Default language for all conversation items in BCP 47 language representation.
+ /// List of conversation items.
+ /// Keeps track of any properties unknown to the library.
+ internal AIConversation(string id, InputModality modality, string language, IList conversationItems, IDictionary serializedAdditionalRawData)
+ {
+ Id = id;
+ Modality = modality;
+ Language = language;
+ ConversationItems = conversationItems;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal AIConversation()
+ {
+ }
+
+ /// The ID of the conversation.
+ public string Id { get; }
+ /// Default modality for all conversation items.
+ public InputModality Modality { get; }
+ /// Default language for all conversation items in BCP 47 language representation.
+ public string Language { get; }
+ /// List of conversation items.
+ public IList ConversationItems { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationActionResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationActionResult.Serialization.cs
index d25f620a5647..101a61e21424 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationActionResult.Serialization.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationActionResult.Serialization.cs
@@ -77,6 +77,7 @@ internal static AnalyzeConversationActionResult DeserializeAnalyzeConversationAc
{
switch (discriminator.GetString())
{
+ case "ConversationalAIResult": return ConversationalAITaskResult.DeserializeConversationalAITaskResult(element, options);
case "ConversationResult": return ConversationActionResult.DeserializeConversationActionResult(element, options);
}
}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationActionResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationActionResult.cs
index bebd1c06e073..6ffb213f3bd6 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationActionResult.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationActionResult.cs
@@ -13,7 +13,7 @@ namespace Azure.AI.Language.Conversations.Models
///
/// The base class of a conversation input task result.
/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include .
+ /// The available derived classes include and .
///
public abstract partial class AnalyzeConversationActionResult
{
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInput.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInput.Serialization.cs
index cbc082280ec5..b02fc538fb63 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInput.Serialization.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInput.Serialization.cs
@@ -78,6 +78,7 @@ internal static AnalyzeConversationInput DeserializeAnalyzeConversationInput(Jso
switch (discriminator.GetString())
{
case "Conversation": return ConversationLanguageUnderstandingInput.DeserializeConversationLanguageUnderstandingInput(element, options);
+ case "ConversationalAI": return ConversationalAITask.DeserializeConversationalAITask(element, options);
}
}
return UnknownAnalyzeConversationInput.DeserializeUnknownAnalyzeConversationInput(element, options);
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInput.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInput.cs
index 47017c4aff6f..eea6091fb785 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInput.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInput.cs
@@ -13,7 +13,7 @@ namespace Azure.AI.Language.Conversations.Models
///
/// The base class of a conversation input task.
/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include .
+ /// The available derived classes include and .
///
public abstract partial class AnalyzeConversationInput
{
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInputKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInputKind.cs
index 68abead3b048..514dfd4789eb 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInputKind.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationInputKind.cs
@@ -23,9 +23,12 @@ public AnalyzeConversationInputKind(string value)
}
private const string ConversationValue = "Conversation";
+ private const string ConversationalAIValue = "ConversationalAI";
/// Conversation task kind.
public static AnalyzeConversationInputKind Conversation { get; } = new AnalyzeConversationInputKind(ConversationValue);
+ /// Conversation task kind.
+ public static AnalyzeConversationInputKind ConversationalAI { get; } = new AnalyzeConversationInputKind(ConversationalAIValue);
/// Determines if two values are the same.
public static bool operator ==(AnalyzeConversationInputKind left, AnalyzeConversationInputKind right) => left.Equals(right);
/// Determines if two values are not the same.
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationOperationInput.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationOperationInput.Serialization.cs
index b239b8609ce1..f3fb27fa3789 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationOperationInput.Serialization.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationOperationInput.Serialization.cs
@@ -48,6 +48,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
writer.WriteObjectValue(item, options);
}
writer.WriteEndArray();
+ if (Optional.IsDefined(CancelAfter))
+ {
+ writer.WritePropertyName("cancelAfter"u8);
+ writer.WriteNumberValue(CancelAfter.Value);
+ }
if (options.Format != "W" && _serializedAdditionalRawData != null)
{
foreach (var item in _serializedAdditionalRawData)
@@ -88,6 +93,7 @@ internal static AnalyzeConversationOperationInput DeserializeAnalyzeConversation
string displayName = default;
MultiLanguageConversationInput analysisInput = default;
IList tasks = default;
+ float? cancelAfter = default;
IDictionary serializedAdditionalRawData = default;
Dictionary rawDataDictionary = new Dictionary();
foreach (var property in element.EnumerateObject())
@@ -112,13 +118,22 @@ internal static AnalyzeConversationOperationInput DeserializeAnalyzeConversation
tasks = array;
continue;
}
+ if (property.NameEquals("cancelAfter"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ cancelAfter = property.Value.GetSingle();
+ continue;
+ }
if (options.Format != "W")
{
rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
}
}
serializedAdditionalRawData = rawDataDictionary;
- return new AnalyzeConversationOperationInput(displayName, analysisInput, tasks, serializedAdditionalRawData);
+ return new AnalyzeConversationOperationInput(displayName, analysisInput, tasks, cancelAfter, serializedAdditionalRawData);
}
BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationOperationInput.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationOperationInput.cs
index eb05c4127ece..3448d5e2227f 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationOperationInput.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationOperationInput.cs
@@ -71,12 +71,14 @@ public AnalyzeConversationOperationInput(MultiLanguageConversationInput conversa
/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
/// The available derived classes include , and .
///
+ /// Optional duration in seconds after which the job will be canceled if not completed.
/// Keeps track of any properties unknown to the library.
- internal AnalyzeConversationOperationInput(string displayName, MultiLanguageConversationInput conversationInput, IList actions, IDictionary serializedAdditionalRawData)
+ internal AnalyzeConversationOperationInput(string displayName, MultiLanguageConversationInput conversationInput, IList actions, float? cancelAfter, IDictionary serializedAdditionalRawData)
{
DisplayName = displayName;
ConversationInput = conversationInput;
Actions = actions;
+ CancelAfter = cancelAfter;
_serializedAdditionalRawData = serializedAdditionalRawData;
}
@@ -95,5 +97,7 @@ internal AnalyzeConversationOperationInput()
/// The available derived classes include , and .
///
public IList Actions { get; }
+ /// Optional duration in seconds after which the job will be canceled if not completed.
+ public float? CancelAfter { get; set; }
}
}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationResultKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationResultKind.cs
index d0aa79cdc7ad..8fc98cb59c8a 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationResultKind.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationResultKind.cs
@@ -23,9 +23,12 @@ public AnalyzeConversationResultKind(string value)
}
private const string ConversationResultValue = "ConversationResult";
+ private const string ConversationalAIResultValue = "ConversationalAIResult";
/// Conversation result task kind.
public static AnalyzeConversationResultKind ConversationResult { get; } = new AnalyzeConversationResultKind(ConversationResultValue);
+ /// Conversation result task kind.
+ public static AnalyzeConversationResultKind ConversationalAIResult { get; } = new AnalyzeConversationResultKind(ConversationalAIResultValue);
/// Determines if two values are the same.
public static bool operator ==(AnalyzeConversationResultKind left, AnalyzeConversationResultKind right) => left.Equals(right);
/// Determines if two values are not the same.
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationItemRange.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationItemRange.Serialization.cs
new file mode 100644
index 000000000000..289b8461e908
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationItemRange.Serialization.cs
@@ -0,0 +1,150 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ public partial class ConversationItemRange : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationItemRange)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("offset"u8);
+ writer.WriteNumberValue(Offset);
+ writer.WritePropertyName("count"u8);
+ writer.WriteNumberValue(Count);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ ConversationItemRange IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationItemRange)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeConversationItemRange(document.RootElement, options);
+ }
+
+ internal static ConversationItemRange DeserializeConversationItemRange(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ int offset = default;
+ int count = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("offset"u8))
+ {
+ offset = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("count"u8))
+ {
+ count = property.Value.GetInt32();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ConversationItemRange(offset, count, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(ConversationItemRange)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ConversationItemRange IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationItemRange(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ConversationItemRange)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ConversationItemRange FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationItemRange(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationItemRange.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationItemRange.cs
new file mode 100644
index 000000000000..1426841d90cb
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationItemRange.cs
@@ -0,0 +1,78 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ /// The ranges of conversation items where this intent was identified.
+ public partial class ConversationItemRange
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The starting index of the intent occurrence within the conversation.
+ /// The number of continuous conversation items for this intent.
+ internal ConversationItemRange(int offset, int count)
+ {
+ Offset = offset;
+ Count = count;
+ }
+
+ /// Initializes a new instance of .
+ /// The starting index of the intent occurrence within the conversation.
+ /// The number of continuous conversation items for this intent.
+ /// Keeps track of any properties unknown to the library.
+ internal ConversationItemRange(int offset, int count, IDictionary serializedAdditionalRawData)
+ {
+ Offset = offset;
+ Count = count;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal ConversationItemRange()
+ {
+ }
+
+ /// The starting index of the intent occurrence within the conversation.
+ public int Offset { get; }
+ /// The number of continuous conversation items for this intent.
+ public int Count { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysis.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysis.Serialization.cs
new file mode 100644
index 000000000000..4940b58f609c
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysis.Serialization.cs
@@ -0,0 +1,185 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ public partial class ConversationalAIAnalysis : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIAnalysis)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("id"u8);
+ writer.WriteStringValue(Id);
+ writer.WritePropertyName("intents"u8);
+ writer.WriteStartArray();
+ foreach (var item in Intents)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ if (Optional.IsCollectionDefined(Entities))
+ {
+ writer.WritePropertyName("entities"u8);
+ writer.WriteStartArray();
+ foreach (var item in Entities)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ ConversationalAIAnalysis IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIAnalysis)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeConversationalAIAnalysis(document.RootElement, options);
+ }
+
+ internal static ConversationalAIAnalysis DeserializeConversationalAIAnalysis(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string id = default;
+ IReadOnlyList intents = default;
+ IReadOnlyList entities = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("id"u8))
+ {
+ id = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("intents"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(ConversationalAIIntent.DeserializeConversationalAIIntent(item, options));
+ }
+ intents = array;
+ continue;
+ }
+ if (property.NameEquals("entities"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(ConversationalAIEntity.DeserializeConversationalAIEntity(item, options));
+ }
+ entities = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ConversationalAIAnalysis(id, intents, entities ?? new ChangeTrackingList(), serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIAnalysis)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ConversationalAIAnalysis IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIAnalysis(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIAnalysis)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ConversationalAIAnalysis FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIAnalysis(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysis.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysis.cs
new file mode 100644
index 000000000000..58e897dcf95d
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysis.cs
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ /// Multiple multi-turn conversations analyzed.
+ public partial class ConversationalAIAnalysis
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The ID of the conversation.
+ /// The intent classification results for this conversation.
+ /// or is null.
+ internal ConversationalAIAnalysis(string id, IEnumerable intents)
+ {
+ Argument.AssertNotNull(id, nameof(id));
+ Argument.AssertNotNull(intents, nameof(intents));
+
+ Id = id;
+ Intents = intents.ToList();
+ Entities = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the conversation.
+ /// The intent classification results for this conversation.
+ /// Global entities that are matched but not associated with any specific intent.
+ /// Keeps track of any properties unknown to the library.
+ internal ConversationalAIAnalysis(string id, IReadOnlyList intents, IReadOnlyList entities, IDictionary serializedAdditionalRawData)
+ {
+ Id = id;
+ Intents = intents;
+ Entities = entities;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal ConversationalAIAnalysis()
+ {
+ }
+
+ /// The ID of the conversation.
+ public string Id { get; }
+ /// The intent classification results for this conversation.
+ public IReadOnlyList Intents { get; }
+ /// Global entities that are matched but not associated with any specific intent.
+ public IReadOnlyList Entities { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysisInput.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysisInput.Serialization.cs
new file mode 100644
index 000000000000..d1cfc7709784
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysisInput.Serialization.cs
@@ -0,0 +1,152 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ public partial class ConversationalAIAnalysisInput : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIAnalysisInput)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("conversations"u8);
+ writer.WriteStartArray();
+ foreach (var item in Conversations)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ ConversationalAIAnalysisInput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIAnalysisInput)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeConversationalAIAnalysisInput(document.RootElement, options);
+ }
+
+ internal static ConversationalAIAnalysisInput DeserializeConversationalAIAnalysisInput(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ IList conversations = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("conversations"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(AIConversation.DeserializeAIConversation(item, options));
+ }
+ conversations = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ConversationalAIAnalysisInput(conversations, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIAnalysisInput)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ConversationalAIAnalysisInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIAnalysisInput(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIAnalysisInput)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ConversationalAIAnalysisInput FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIAnalysisInput(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysisInput.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysisInput.cs
new file mode 100644
index 000000000000..4f8775f55e65
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysisInput.cs
@@ -0,0 +1,76 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ /// The input ConversationItem and its optional parameters.
+ public partial class ConversationalAIAnalysisInput
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// List of multiple conversations.
+ /// is null.
+ public ConversationalAIAnalysisInput(IEnumerable conversations)
+ {
+ Argument.AssertNotNull(conversations, nameof(conversations));
+
+ Conversations = conversations.ToList();
+ }
+
+ /// Initializes a new instance of .
+ /// List of multiple conversations.
+ /// Keeps track of any properties unknown to the library.
+ internal ConversationalAIAnalysisInput(IList conversations, IDictionary serializedAdditionalRawData)
+ {
+ Conversations = conversations;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal ConversationalAIAnalysisInput()
+ {
+ }
+
+ /// List of multiple conversations.
+ public IList Conversations { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIEntity.Serialization.cs
new file mode 100644
index 000000000000..1fa99f120e38
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIEntity.Serialization.cs
@@ -0,0 +1,257 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ public partial class ConversationalAIEntity : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIEntity)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ writer.WritePropertyName("text"u8);
+ writer.WriteStringValue(Text);
+ writer.WritePropertyName("confidenceScore"u8);
+ writer.WriteNumberValue(ConfidenceScore);
+ writer.WritePropertyName("offset"u8);
+ writer.WriteNumberValue(Offset);
+ writer.WritePropertyName("length"u8);
+ writer.WriteNumberValue(Length);
+ writer.WritePropertyName("conversationItemId"u8);
+ writer.WriteStringValue(ConversationItemId);
+ if (Optional.IsDefined(ConversationItemIndex))
+ {
+ writer.WritePropertyName("conversationItemIndex"u8);
+ writer.WriteNumberValue(ConversationItemIndex.Value);
+ }
+ if (Optional.IsCollectionDefined(Resolutions))
+ {
+ writer.WritePropertyName("resolutions"u8);
+ writer.WriteStartArray();
+ foreach (var item in Resolutions)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
+ if (Optional.IsCollectionDefined(ExtraInformation))
+ {
+ writer.WritePropertyName("extraInformation"u8);
+ writer.WriteStartArray();
+ foreach (var item in ExtraInformation)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ ConversationalAIEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIEntity)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeConversationalAIEntity(document.RootElement, options);
+ }
+
+ internal static ConversationalAIEntity DeserializeConversationalAIEntity(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string name = default;
+ string text = default;
+ float confidenceScore = default;
+ int offset = default;
+ int length = default;
+ string conversationItemId = default;
+ int? conversationItemIndex = default;
+ IReadOnlyList resolutions = default;
+ IReadOnlyList extraInformation = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("name"u8))
+ {
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("text"u8))
+ {
+ text = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("confidenceScore"u8))
+ {
+ confidenceScore = property.Value.GetSingle();
+ continue;
+ }
+ if (property.NameEquals("offset"u8))
+ {
+ offset = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("length"u8))
+ {
+ length = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("conversationItemId"u8))
+ {
+ conversationItemId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("conversationItemIndex"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ conversationItemIndex = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("resolutions"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(ResolutionBase.DeserializeResolutionBase(item, options));
+ }
+ resolutions = array;
+ continue;
+ }
+ if (property.NameEquals("extraInformation"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(ConversationEntityExtraInformation.DeserializeConversationEntityExtraInformation(item, options));
+ }
+ extraInformation = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ConversationalAIEntity(
+ name,
+ text,
+ confidenceScore,
+ offset,
+ length,
+ conversationItemId,
+ conversationItemIndex,
+ resolutions ?? new ChangeTrackingList(),
+ extraInformation ?? new ChangeTrackingList(),
+ serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIEntity)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ConversationalAIEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIEntity(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIEntity)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ConversationalAIEntity FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIEntity(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIEntity.cs
new file mode 100644
index 000000000000..5b22d5da4625
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIEntity.cs
@@ -0,0 +1,137 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ /// The entity associated with this intent.
+ public partial class ConversationalAIEntity
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The entity name or category.
+ /// The detected text of the entity.
+ /// The confidence score of the entity detection (0.0 to 1.0).
+ /// The starting index of the entity in the query.
+ /// The length of the detected entity text.
+ /// The ID of the conversation item where the entity appears.
+ /// , or is null.
+ internal ConversationalAIEntity(string name, string text, float confidenceScore, int offset, int length, string conversationItemId)
+ {
+ Argument.AssertNotNull(name, nameof(name));
+ Argument.AssertNotNull(text, nameof(text));
+ Argument.AssertNotNull(conversationItemId, nameof(conversationItemId));
+
+ Name = name;
+ Text = text;
+ ConfidenceScore = confidenceScore;
+ Offset = offset;
+ Length = length;
+ ConversationItemId = conversationItemId;
+ Resolutions = new ChangeTrackingList();
+ ExtraInformation = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ /// The entity name or category.
+ /// The detected text of the entity.
+ /// The confidence score of the entity detection (0.0 to 1.0).
+ /// The starting index of the entity in the query.
+ /// The length of the detected entity text.
+ /// The ID of the conversation item where the entity appears.
+ /// The index of the conversation item where the entity appears.
+ ///
+ /// Entity resolution details, if available.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include , , , , , , , , , , , , , and .
+ ///
+ ///
+ /// Additional entity metadata.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include , and .
+ ///
+ /// Keeps track of any properties unknown to the library.
+ internal ConversationalAIEntity(string name, string text, float confidenceScore, int offset, int length, string conversationItemId, int? conversationItemIndex, IReadOnlyList resolutions, IReadOnlyList extraInformation, IDictionary serializedAdditionalRawData)
+ {
+ Name = name;
+ Text = text;
+ ConfidenceScore = confidenceScore;
+ Offset = offset;
+ Length = length;
+ ConversationItemId = conversationItemId;
+ ConversationItemIndex = conversationItemIndex;
+ Resolutions = resolutions;
+ ExtraInformation = extraInformation;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal ConversationalAIEntity()
+ {
+ }
+
+ /// The entity name or category.
+ public string Name { get; }
+ /// The detected text of the entity.
+ public string Text { get; }
+ /// The confidence score of the entity detection (0.0 to 1.0).
+ public float ConfidenceScore { get; }
+ /// The starting index of the entity in the query.
+ public int Offset { get; }
+ /// The length of the detected entity text.
+ public int Length { get; }
+ /// The ID of the conversation item where the entity appears.
+ public string ConversationItemId { get; }
+ /// The index of the conversation item where the entity appears.
+ public int? ConversationItemIndex { get; }
+ ///
+ /// Entity resolution details, if available.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include , , , , , , , , , , , , , and .
+ ///
+ public IReadOnlyList Resolutions { get; }
+ ///
+ /// Additional entity metadata.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include , and .
+ ///
+ public IReadOnlyList ExtraInformation { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIInputParameters.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIInputParameters.Serialization.cs
new file mode 100644
index 000000000000..4282119cdc2f
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIInputParameters.Serialization.cs
@@ -0,0 +1,165 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ public partial class ConversationalAIInputParameters : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIInputParameters)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("projectName"u8);
+ writer.WriteStringValue(ProjectName);
+ writer.WritePropertyName("deploymentName"u8);
+ writer.WriteStringValue(DeploymentName);
+ if (Optional.IsDefined(StringIndexType))
+ {
+ writer.WritePropertyName("stringIndexType"u8);
+ writer.WriteStringValue(StringIndexType.Value.ToString());
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ ConversationalAIInputParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIInputParameters)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeConversationalAIInputParameters(document.RootElement, options);
+ }
+
+ internal static ConversationalAIInputParameters DeserializeConversationalAIInputParameters(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string projectName = default;
+ string deploymentName = default;
+ StringIndexType? stringIndexType = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("projectName"u8))
+ {
+ projectName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("deploymentName"u8))
+ {
+ deploymentName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("stringIndexType"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ stringIndexType = new StringIndexType(property.Value.GetString());
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ConversationalAIInputParameters(projectName, deploymentName, stringIndexType, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIInputParameters)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ConversationalAIInputParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIInputParameters(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIInputParameters)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ConversationalAIInputParameters FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIInputParameters(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIInputParameters.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIInputParameters.cs
new file mode 100644
index 000000000000..7d3b4467b001
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIInputParameters.cs
@@ -0,0 +1,86 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ /// Input parameters base for a Conversation task.
+ public partial class ConversationalAIInputParameters
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The name of the project to use.
+ /// The name of the deployment to use.
+ /// or is null.
+ public ConversationalAIInputParameters(string projectName, string deploymentName)
+ {
+ Argument.AssertNotNull(projectName, nameof(projectName));
+ Argument.AssertNotNull(deploymentName, nameof(deploymentName));
+
+ ProjectName = projectName;
+ DeploymentName = deploymentName;
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the project to use.
+ /// The name of the deployment to use.
+ /// Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets.
+ /// Keeps track of any properties unknown to the library.
+ internal ConversationalAIInputParameters(string projectName, string deploymentName, StringIndexType? stringIndexType, IDictionary serializedAdditionalRawData)
+ {
+ ProjectName = projectName;
+ DeploymentName = deploymentName;
+ StringIndexType = stringIndexType;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal ConversationalAIInputParameters()
+ {
+ }
+
+ /// The name of the project to use.
+ public string ProjectName { get; }
+ /// The name of the deployment to use.
+ public string DeploymentName { get; }
+ /// Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets.
+ public StringIndexType? StringIndexType { get; set; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIIntent.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIIntent.Serialization.cs
new file mode 100644
index 000000000000..0f493ff9ab2b
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIIntent.Serialization.cs
@@ -0,0 +1,186 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ public partial class ConversationalAIIntent : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIIntent)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type);
+ writer.WritePropertyName("conversationItemRanges"u8);
+ writer.WriteStartArray();
+ foreach (var item in ConversationItemRanges)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ writer.WritePropertyName("entities"u8);
+ writer.WriteStartArray();
+ foreach (var item in Entities)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ ConversationalAIIntent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIIntent)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeConversationalAIIntent(document.RootElement, options);
+ }
+
+ internal static ConversationalAIIntent DeserializeConversationalAIIntent(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string name = default;
+ string type = default;
+ IReadOnlyList conversationItemRanges = default;
+ IReadOnlyList entities = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("name"u8))
+ {
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("conversationItemRanges"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(ConversationItemRange.DeserializeConversationItemRange(item, options));
+ }
+ conversationItemRanges = array;
+ continue;
+ }
+ if (property.NameEquals("entities"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(ConversationalAIEntity.DeserializeConversationalAIEntity(item, options));
+ }
+ entities = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ConversationalAIIntent(name, type, conversationItemRanges, entities, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIIntent)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ConversationalAIIntent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIIntent(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIIntent)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ConversationalAIIntent FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIIntent(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIIntent.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIIntent.cs
new file mode 100644
index 000000000000..d3092e7745dc
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIIntent.cs
@@ -0,0 +1,97 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ /// The intent classification result for this conversation.
+ public partial class ConversationalAIIntent
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The name of the detected intent.
+ /// The type of intent, either "action" or "question".
+ /// The ranges of conversation items where this intent was identified.
+ /// The entities associated with this intent.
+ /// , , or is null.
+ internal ConversationalAIIntent(string name, string type, IEnumerable conversationItemRanges, IEnumerable entities)
+ {
+ Argument.AssertNotNull(name, nameof(name));
+ Argument.AssertNotNull(type, nameof(type));
+ Argument.AssertNotNull(conversationItemRanges, nameof(conversationItemRanges));
+ Argument.AssertNotNull(entities, nameof(entities));
+
+ Name = name;
+ Type = type;
+ ConversationItemRanges = conversationItemRanges.ToList();
+ Entities = entities.ToList();
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the detected intent.
+ /// The type of intent, either "action" or "question".
+ /// The ranges of conversation items where this intent was identified.
+ /// The entities associated with this intent.
+ /// Keeps track of any properties unknown to the library.
+ internal ConversationalAIIntent(string name, string type, IReadOnlyList conversationItemRanges, IReadOnlyList entities, IDictionary serializedAdditionalRawData)
+ {
+ Name = name;
+ Type = type;
+ ConversationItemRanges = conversationItemRanges;
+ Entities = entities;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal ConversationalAIIntent()
+ {
+ }
+
+ /// The name of the detected intent.
+ public string Name { get; }
+ /// The type of intent, either "action" or "question".
+ public string Type { get; }
+ /// The ranges of conversation items where this intent was identified.
+ public IReadOnlyList ConversationItemRanges { get; }
+ /// The entities associated with this intent.
+ public IReadOnlyList Entities { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIItem.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIItem.Serialization.cs
new file mode 100644
index 000000000000..2e0a86a2be7c
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIItem.Serialization.cs
@@ -0,0 +1,158 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ public partial class ConversationalAIItem : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIItem)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("id"u8);
+ writer.WriteStringValue(Id);
+ writer.WritePropertyName("participantId"u8);
+ writer.WriteStringValue(ParticipantId);
+ writer.WritePropertyName("text"u8);
+ writer.WriteStringValue(Text);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ ConversationalAIItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIItem)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeConversationalAIItem(document.RootElement, options);
+ }
+
+ internal static ConversationalAIItem DeserializeConversationalAIItem(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string id = default;
+ string participantId = default;
+ string text = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("id"u8))
+ {
+ id = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("participantId"u8))
+ {
+ participantId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("text"u8))
+ {
+ text = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ConversationalAIItem(id, participantId, text, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIItem)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ConversationalAIItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIItem(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIItem)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ConversationalAIItem FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIItem(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIItem.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIItem.cs
new file mode 100644
index 000000000000..7dac48ab7fad
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIItem.cs
@@ -0,0 +1,89 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ /// List of conversation items.
+ public partial class ConversationalAIItem
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The ID of a conversation item.
+ /// The participant ID of a conversation item.
+ /// The text input.
+ /// , or is null.
+ public ConversationalAIItem(string id, string participantId, string text)
+ {
+ Argument.AssertNotNull(id, nameof(id));
+ Argument.AssertNotNull(participantId, nameof(participantId));
+ Argument.AssertNotNull(text, nameof(text));
+
+ Id = id;
+ ParticipantId = participantId;
+ Text = text;
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of a conversation item.
+ /// The participant ID of a conversation item.
+ /// The text input.
+ /// Keeps track of any properties unknown to the library.
+ internal ConversationalAIItem(string id, string participantId, string text, IDictionary serializedAdditionalRawData)
+ {
+ Id = id;
+ ParticipantId = participantId;
+ Text = text;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal ConversationalAIItem()
+ {
+ }
+
+ /// The ID of a conversation item.
+ public string Id { get; }
+ /// The participant ID of a conversation item.
+ public string ParticipantId { get; }
+ /// The text input.
+ public string Text { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIResult.Serialization.cs
new file mode 100644
index 000000000000..2bdeac0d9c0f
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIResult.Serialization.cs
@@ -0,0 +1,177 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ public partial class ConversationalAIResult : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIResult)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("conversations"u8);
+ writer.WriteStartArray();
+ foreach (var item in Conversations)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ if (Optional.IsCollectionDefined(Warnings))
+ {
+ writer.WritePropertyName("warnings"u8);
+ writer.WriteStartArray();
+ foreach (var item in Warnings)
+ {
+ writer.WriteStringValue(item);
+ }
+ writer.WriteEndArray();
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ ConversationalAIResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ConversationalAIResult)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeConversationalAIResult(document.RootElement, options);
+ }
+
+ internal static ConversationalAIResult DeserializeConversationalAIResult(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ IReadOnlyList conversations = default;
+ IReadOnlyList warnings = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("conversations"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(ConversationalAIAnalysis.DeserializeConversationalAIAnalysis(item, options));
+ }
+ conversations = array;
+ continue;
+ }
+ if (property.NameEquals("warnings"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(item.GetString());
+ }
+ warnings = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ConversationalAIResult(conversations, warnings ?? new ChangeTrackingList(), serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIResult)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ConversationalAIResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIResult(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIResult)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ConversationalAIResult FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIResult(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIResult.cs
new file mode 100644
index 000000000000..d9d9f3be4ff8
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIResult.cs
@@ -0,0 +1,81 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.AI.Language.Conversations.Models
+{
+ /// Represents the conversational analysis response.
+ public partial class ConversationalAIResult
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// Multiple multi-turn conversations analyzed.
+ /// is null.
+ internal ConversationalAIResult(IEnumerable conversations)
+ {
+ Argument.AssertNotNull(conversations, nameof(conversations));
+
+ Conversations = conversations.ToList();
+ Warnings = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ /// Multiple multi-turn conversations analyzed.
+ /// Any warnings encountered during processing.
+ /// Keeps track of any properties unknown to the library.
+ internal ConversationalAIResult(IReadOnlyList conversations, IReadOnlyList warnings, IDictionary serializedAdditionalRawData)
+ {
+ Conversations = conversations;
+ Warnings = warnings;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ ///