I am able to run the sample documentation mentioned above with dot 8 or 9 version and Documentation recommends only Dot net 8 most of the tutorial
but you can check 2.2.0-beta.2 documentation for 4.6.2 dot net framework
dotnet add package Azure.AI.Language.Conversations --version 2.0.0-beta.2
Sample usage
string projectName = "Menu";
string deploymentName = "production";
AnalyzeConversationInput data = new ConversationLanguageUnderstandingInput(
new ConversationAnalysisInput(
new TextConversationItem(
id: "1",
participantId: "participant1",
text: "Send an email to Carol about tomorrow's demo")),
new ConversationLanguageUnderstandingActionContent(projectName, deploymentName)
{
// Use Utf16CodeUnit for strings in .NET.
StringIndexType = StringIndexType.Utf16CodeUnit,
});
Response<AnalyzeConversationActionResult> response = client.AnalyzeConversation(data);
ConversationActionResult conversationActionResult = response.Value as ConversationActionResult;
ConversationPrediction conversationPrediction = conversationActionResult.Result.Prediction as ConversationPrediction;
Console.WriteLine($"Top intent: {conversationPrediction.TopIntent}");
Console.WriteLine("Intents:");
foreach (ConversationIntent intent in conversationPrediction.Intents)
{
Console.WriteLine($"Category: {intent.Category}");
Console.WriteLine($"Confidence: {intent.Confidence}");
Console.WriteLine();
}
Console.WriteLine("Entities:");
foreach (ConversationEntity entity in conversationPrediction.Entities)
{
Console.WriteLine($"Category: {entity.Category}");
Console.WriteLine($"Text: {entity.Text}");
Console.WriteLine($"Offset: {entity.Offset}");
Console.WriteLine($"Length: {entity.Length}");
Console.WriteLine($"Confidence: {entity.Confidence}");
Console.WriteLine();
if (entity.Resolutions != null && entity.Resolutions.Any())
{
foreach (ResolutionBase resolution in entity.Resolutions)
{
if (resolution is DateTimeResolution dateTimeResolution)
{
Console.WriteLine($"Datetime Sub Kind: {dateTimeResolution.DateTimeSubKind}");
Console.WriteLine($"Timex: {dateTimeResolution.Timex}");
Console.WriteLine($"Value: {dateTimeResolution.Value}");
Console.WriteLine();
}
}
}
}
Please let us know if it helps.
Thank you