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..843c40fdc398 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;
/// The version of the service to use.
public enum ServiceVersion
@@ -26,8 +26,8 @@ public enum ServiceVersion
V2024_05_01 = 3,
/// Service version "2024-11-01".
V2024_11_01 = 4,
- /// Service version "2024-11-15-preview".
- V2024_11_15_Preview = 5,
+ /// Service version "2025-05-15".
+ V2025_05_15 = 5,
}
internal string Version { get; }
@@ -41,7 +41,7 @@ public ConversationsClientOptions(ServiceVersion version = LatestVersion)
ServiceVersion.V2023_04_01 => "2023-04-01",
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 => "2025-05-15",
_ => 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..ff5d558ebac2 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsModelFactory.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsModelFactory.cs
@@ -15,13 +15,43 @@ 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 ConversationLanguageUnderstandingInput ConversationLanguageUnderstandingInput(ConversationAnalysisInput conversationInput = null, ConversationLanguageUnderstandingActionContent actionContent = null)
+ /// 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(ConversationalAIAnalysisOptions analysisInput = null, ConversationalAITaskParameters parameters = null)
{
- return new ConversationLanguageUnderstandingInput(AnalyzeConversationInputKind.Conversation, serializedAdditionalRawData: null, conversationInput, actionContent);
+ return new ConversationalAITask(AnalyzeConversationInputKind.ConversationalAI, serializedAdditionalRawData: null, analysisInput, parameters);
+ }
+
+ /// Initializes a new instance of .
+ /// Unique identifier for the conversation.
+ /// Language of the conversation item in BCP-47 format.
+ /// modality.
+ /// domain.
+ /// A new instance for mocking.
+ public static ConversationInput ConversationInput(string id = null, string language = null, string modality = null, ConversationDomain? domain = null)
+ {
+ return new UnknownConversationInput(id, language, modality == null ? default : new InputModality(modality), domain, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Unique identifier for the conversation.
+ /// Language of the conversation item in BCP-47 format.
+ /// domain.
+ /// Ordered list of text conversation items in the conversation.
+ /// A new instance for mocking.
+ public static TextConversation TextConversation(string id = null, string language = null, ConversationDomain? domain = null, IEnumerable conversationItems = null)
+ {
+ conversationItems ??= new List();
+
+ return new TextConversation(
+ id,
+ language,
+ InputModality.Text,
+ domain,
+ serializedAdditionalRawData: null,
+ conversationItems?.ToList());
}
/// Initializes a new instance of .
@@ -44,6 +74,76 @@ public static TextConversationItem TextConversationItem(string id = null, string
serializedAdditionalRawData: null);
}
+ /// Initializes a new instance of .
+ /// Unique identifier for the conversation.
+ /// Language of the conversation item in BCP-47 format.
+ /// domain.
+ /// Ordered list of transcript conversation items in the conversation.
+ /// A new instance for mocking.
+ public static TranscriptConversation TranscriptConversation(string id = null, string language = null, ConversationDomain? domain = null, IEnumerable conversationItems = null)
+ {
+ conversationItems ??= new List();
+
+ return new TranscriptConversation(
+ id,
+ language,
+ InputModality.Transcript,
+ domain,
+ serializedAdditionalRawData: null,
+ conversationItems?.ToList());
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of a conversation item.
+ /// The participant ID of a conversation item.
+ /// The override language of a conversation item in BCP 47 language representation.
+ /// Enumeration of supported conversational modalities.
+ /// Role of the participant.
+ /// Inverse text normalization (ITN) representation of input. The inverse-text-normalized form is the recognized text from Microsoft's speech-to-text API, with phone numbers, numbers, abbreviations, and other transformations applied.
+ /// Inverse-text-normalized format with profanity masking applied.
+ /// Display form of the recognized text from the speech-to-text API, with punctuation and capitalization added.
+ /// Lexical form of the recognized text from the speech-to-text API, with the actual words recognized.
+ /// List of word-level audio timing information.
+ /// Audio timing at the conversation item level. This still can help with AI quality if word-level audio timings are not available.
+ /// A new instance for mocking.
+ public static TranscriptConversationItem TranscriptConversationItem(string id = null, string participantId = null, string language = null, InputModality? modality = null, ParticipantRole? role = null, string inverseTextNormalized = null, string maskedInverseTextNormalized = null, string text = null, string lexical = null, IEnumerable wordLevelTimings = null, ConversationItemLevelTiming conversationItemLevelTiming = null)
+ {
+ wordLevelTimings ??= new List();
+
+ return new TranscriptConversationItem(
+ id,
+ participantId,
+ language,
+ modality,
+ role,
+ inverseTextNormalized,
+ maskedInverseTextNormalized,
+ text,
+ lexical,
+ wordLevelTimings?.ToList(),
+ conversationItemLevelTiming,
+ serializedAdditionalRawData: null);
+ }
+
+ /// 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 ConversationalAITaskParameters ConversationalAITaskParameters(string projectName = null, string deploymentName = null, StringIndexType? stringIndexType = null)
+ {
+ return new ConversationalAITaskParameters(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.
+ /// A new instance for mocking.
+ public static ConversationLanguageUnderstandingInput ConversationLanguageUnderstandingInput(ConversationAnalysisInput conversationInput = null, ConversationLanguageUnderstandingActionContent actionContent = null)
+ {
+ return new ConversationLanguageUnderstandingInput(AnalyzeConversationInputKind.Conversation, serializedAdditionalRawData: null, conversationInput, actionContent);
+ }
+
/// Initializes a new instance of .
/// The name of the project to use.
/// The name of the deployment to use.
@@ -81,87 +181,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 +466,105 @@ 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.
+ /// The intent classification results.
+ /// The entity extraction results.
+ /// A new instance for mocking.
+ public static ConversationalAIPrediction ConversationalAIPrediction(string topIntent = null, IEnumerable intents = null, IEnumerable entities = null)
+ {
+ intents ??= new List();
+ entities ??= new List();
+
+ return new ConversationalAIPrediction(ProjectKind.ConversationalAI, topIntent, serializedAdditionalRawData: null, intents?.ToList(), entities?.ToList());
+ }
+
/// Initializes a new instance of .
/// The intent with the highest score.
///
@@ -903,93 +1109,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);
- }
-
- /// Initializes a new instance of .
- /// Unique identifier for the conversation.
- /// Language of the conversation item in BCP-47 format.
- /// modality.
- /// domain.
- /// A new instance for mocking.
- public static ConversationInput ConversationInput(string id = null, string language = null, string modality = null, ConversationDomain? domain = null)
- {
- return new UnknownConversationInput(id, language, modality == null ? default : new InputModality(modality), domain, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Unique identifier for the conversation.
- /// Language of the conversation item in BCP-47 format.
- /// domain.
- /// Ordered list of text conversation items in the conversation.
- /// A new instance for mocking.
- public static TextConversation TextConversation(string id = null, string language = null, ConversationDomain? domain = null, IEnumerable conversationItems = null)
- {
- conversationItems ??= new List();
-
- return new TextConversation(
- id,
- language,
- InputModality.Text,
- domain,
- serializedAdditionalRawData: null,
- conversationItems?.ToList());
- }
-
- /// Initializes a new instance of .
- /// Unique identifier for the conversation.
- /// Language of the conversation item in BCP-47 format.
- /// domain.
- /// Ordered list of transcript conversation items in the conversation.
- /// A new instance for mocking.
- public static TranscriptConversation TranscriptConversation(string id = null, string language = null, ConversationDomain? domain = null, IEnumerable conversationItems = null)
- {
- conversationItems ??= new List();
-
- return new TranscriptConversation(
- id,
- language,
- InputModality.Transcript,
- domain,
- serializedAdditionalRawData: null,
- conversationItems?.ToList());
- }
-
- /// Initializes a new instance of .
- /// The ID of a conversation item.
- /// The participant ID of a conversation item.
- /// The override language of a conversation item in BCP 47 language representation.
- /// Enumeration of supported conversational modalities.
- /// Role of the participant.
- /// Inverse text normalization (ITN) representation of input. The inverse-text-normalized form is the recognized text from Microsoft's speech-to-text API, with phone numbers, numbers, abbreviations, and other transformations applied.
- /// Inverse-text-normalized format with profanity masking applied.
- /// Display form of the recognized text from the speech-to-text API, with punctuation and capitalization added.
- /// Lexical form of the recognized text from the speech-to-text API, with the actual words recognized.
- /// List of word-level audio timing information.
- /// Audio timing at the conversation item level. This still can help with AI quality if word-level audio timings are not available.
- /// A new instance for mocking.
- public static TranscriptConversationItem TranscriptConversationItem(string id = null, string participantId = null, string language = null, InputModality? modality = null, ParticipantRole? role = null, string inverseTextNormalized = null, string maskedInverseTextNormalized = null, string text = null, string lexical = null, IEnumerable wordLevelTimings = null, ConversationItemLevelTiming conversationItemLevelTiming = null)
- {
- wordLevelTimings ??= new List();
-
- return new TranscriptConversationItem(
- id,
- participantId,
- language,
- modality,
- role,
- inverseTextNormalized,
- maskedInverseTextNormalized,
- text,
- lexical,
- wordLevelTimings?.ToList(),
- conversationItemLevelTiming,
- 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..7b8abaf306e1 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 ConversationalAIAnalysisOptions(new ConversationInput[]
+{
+ new TextConversation("order", "en", new TextConversationItem[]
+ {
+ new TextConversationItem("1", "user", "Hi!"),
+ new TextConversationItem("2", "bot", "Hello, how can I help you?"),
+ new TextConversationItem("3", "user", "I would like to book a flight from Paris to Berlin on Oct 10th."),
+ new TextConversationItem("4", "bot", "Do you have any airline preference?"),
+ new TextConversationItem("5", "user", "No."),
+ new TextConversationItem("6", "user", "I like New York and Boston."),
+ new TextConversationItem("7", "user", "Actualy, change the destination to New York."),
+ new TextConversationItem("8", "user", "Wait, I do not like the food in New York."),
+ new TextConversationItem("9", "user", "Ok, change the destination back to Berlin.")
+ })
+}), new ConversationalAITaskParameters("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 ConversationalAIAnalysisOptions(new ConversationInput[]
+{
+ new TextConversation("order", "en", new TextConversationItem[]
+ {
+ new TextConversationItem("1", "user", "Hi!"),
+ new TextConversationItem("2", "bot", "Hello, how can I help you?"),
+ new TextConversationItem("3", "user", "I would like to book a flight from Paris to Berlin on Oct 10th."),
+ new TextConversationItem("4", "bot", "Do you have any airline preference?"),
+ new TextConversationItem("5", "user", "No."),
+ new TextConversationItem("6", "user", "I like New York and Boston."),
+ new TextConversationItem("7", "user", "Actualy, change the destination to New York."),
+ new TextConversationItem("8", "user", "Wait, I do not like the food in New York."),
+ new TextConversationItem("9", "user", "Ok, change the destination back to Berlin.")
+ })
+}), new ConversationalAITaskParameters("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/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/AnalyzeConversationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationResult.cs
index f0e17721934a..6de351f985de 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationResult.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/AnalyzeConversationResult.cs
@@ -50,7 +50,7 @@ public partial class AnalyzeConversationResult
///
/// 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 .
+ /// The available derived classes include , and .
///
/// or is null.
internal AnalyzeConversationResult(string query, PredictionBase prediction)
@@ -68,7 +68,7 @@ internal AnalyzeConversationResult(string query, PredictionBase prediction)
///
/// 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 .
+ /// The available derived classes include , and .
///
/// Keeps track of any properties unknown to the library.
internal AnalyzeConversationResult(string query, string detectedLanguage, PredictionBase prediction, IDictionary serializedAdditionalRawData)
@@ -91,7 +91,7 @@ internal AnalyzeConversationResult()
///
/// 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 .
+ /// The available derived classes include , and .
///
public PredictionBase Prediction { get; }
}
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/ConversationalAIAnalysisOptions.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysisOptions.Serialization.cs
new file mode 100644
index 000000000000..ee0e8a2b2179
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysisOptions.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 ConversationalAIAnalysisOptions : 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(ConversationalAIAnalysisOptions)} 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
+ }
+ }
+ }
+
+ ConversationalAIAnalysisOptions 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(ConversationalAIAnalysisOptions)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeConversationalAIAnalysisOptions(document.RootElement, options);
+ }
+
+ internal static ConversationalAIAnalysisOptions DeserializeConversationalAIAnalysisOptions(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(ConversationInput.DeserializeConversationInput(item, options));
+ }
+ conversations = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ConversationalAIAnalysisOptions(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(ConversationalAIAnalysisOptions)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ConversationalAIAnalysisOptions 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 DeserializeConversationalAIAnalysisOptions(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIAnalysisOptions)} 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 ConversationalAIAnalysisOptions FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIAnalysisOptions(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/ConversationalAIAnalysisOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysisOptions.cs
new file mode 100644
index 000000000000..0583da49a3d8
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIAnalysisOptions.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
+{
+ /// The input ConversationItem and its optional parameters.
+ public partial class ConversationalAIAnalysisOptions
+ {
+ ///
+ /// 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
+ /// 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 .
+ ///
+ /// is null.
+ public ConversationalAIAnalysisOptions(IEnumerable conversations)
+ {
+ Argument.AssertNotNull(conversations, nameof(conversations));
+
+ Conversations = conversations.ToList();
+ }
+
+ /// Initializes a new instance of .
+ ///
+ /// List of multiple conversations
+ /// 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 ConversationalAIAnalysisOptions(IList conversations, IDictionary serializedAdditionalRawData)
+ {
+ Conversations = conversations;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal ConversationalAIAnalysisOptions()
+ {
+ }
+
+ ///
+ /// List of multiple conversations
+ /// 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 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/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/ConversationalAIPrediction.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIPrediction.Serialization.cs
new file mode 100644
index 000000000000..09a3066c8b82
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIPrediction.Serialization.cs
@@ -0,0 +1,168 @@
+// 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 ConversationalAIPrediction : 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 override 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(ConversationalAIPrediction)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ writer.WritePropertyName("intents"u8);
+ writer.WriteStartArray();
+ foreach (var item in Intents)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ writer.WritePropertyName("entities"u8);
+ writer.WriteStartArray();
+ foreach (var item in Entities)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
+
+ ConversationalAIPrediction 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(ConversationalAIPrediction)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeConversationalAIPrediction(document.RootElement, options);
+ }
+
+ internal static ConversationalAIPrediction DeserializeConversationalAIPrediction(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ IReadOnlyList intents = default;
+ IReadOnlyList entities = default;
+ ProjectKind projectKind = default;
+ string topIntent = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("intents"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(ConversationIntent.DeserializeConversationIntent(item, options));
+ }
+ intents = array;
+ continue;
+ }
+ if (property.NameEquals("entities"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(ConversationEntity.DeserializeConversationEntity(item, options));
+ }
+ entities = array;
+ continue;
+ }
+ if (property.NameEquals("projectKind"u8))
+ {
+ projectKind = new ProjectKind(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("topIntent"u8))
+ {
+ topIntent = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ConversationalAIPrediction(projectKind, topIntent, serializedAdditionalRawData, intents, entities);
+ }
+
+ 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(ConversationalAIPrediction)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ConversationalAIPrediction 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 DeserializeConversationalAIPrediction(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ConversationalAIPrediction)} 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 new ConversationalAIPrediction FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConversationalAIPrediction(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override 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/ConversationalAIPrediction.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIPrediction.cs
new file mode 100644
index 000000000000..44df2809ae73
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAIPrediction.cs
@@ -0,0 +1,53 @@
+// 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 prediction section of a Conversation project.
+ public partial class ConversationalAIPrediction : PredictionBase
+ {
+ /// Initializes a new instance of .
+ /// The intent classification results.
+ /// The entity extraction results.
+ /// or is null.
+ internal ConversationalAIPrediction(IEnumerable intents, IEnumerable entities)
+ {
+ Argument.AssertNotNull(intents, nameof(intents));
+ Argument.AssertNotNull(entities, nameof(entities));
+
+ ProjectKind = ProjectKind.ConversationalAI;
+ Intents = intents.ToList();
+ Entities = entities.ToList();
+ }
+
+ /// Initializes a new instance of .
+ /// The type of the project.
+ /// The intent with the highest score.
+ /// Keeps track of any properties unknown to the library.
+ /// The intent classification results.
+ /// The entity extraction results.
+ internal ConversationalAIPrediction(ProjectKind projectKind, string topIntent, IDictionary serializedAdditionalRawData, IReadOnlyList intents, IReadOnlyList entities) : base(projectKind, topIntent, serializedAdditionalRawData)
+ {
+ Intents = intents;
+ Entities = entities;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal ConversationalAIPrediction()
+ {
+ }
+
+ /// The intent classification results.
+ public IReadOnlyList Intents { get; }
+ /// The entity extraction results.
+ public IReadOnlyList Entities { 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;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal ConversationalAIResult()
+ {
+ }
+
+ /// Multiple multi-turn conversations analyzed.
+ public IReadOnlyList Conversations { get; }
+ /// Any warnings encountered during processing.
+ public IReadOnlyList Warnings { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAITask.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAITask.Serialization.cs
new file mode 100644
index 000000000000..33e30ed2e774
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Models/ConversationalAITask.Serialization.cs
@@ -0,0 +1,142 @@
+// 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 ConversationalAITask : 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 override 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(ConversationalAITask)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ writer.WritePropertyName("analysisInput"u8);
+ writer.WriteObjectValue(AnalysisInput, options);
+ writer.WritePropertyName("parameters"u8);
+ writer.WriteObjectValue(Parameters, options);
+ }
+
+ ConversationalAITask 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(ConversationalAITask)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeConversationalAITask(document.RootElement, options);
+ }
+
+ internal static ConversationalAITask DeserializeConversationalAITask(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ ConversationalAIAnalysisOptions analysisInput = default;
+ ConversationalAITaskParameters parameters = default;
+ AnalyzeConversationInputKind kind = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary