ConversationAnalysisClient.AnalyzeConversation Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
[Protocol Method] Analyzes the input conversation utterance.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.Response AnalyzeConversation (Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member AnalyzeConversation : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.AnalyzeConversation : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function AnalyzeConversation (content As RequestContent, Optional context As RequestContext = Nothing) As Response
Parameters
- content
- RequestContent
The content to send as the body of the request.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
content
is null.
Service returned a non-success status code.
Examples
This sample shows how to call AnalyzeConversation with required request content, and how to parse the result.
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new ConversationAnalysisClient(endpoint, credential);
var data = new {
analysisInput = new {
conversationItem = new {
text = "<text>",
id = "<id>",
participantId = "<participantId>",
},
},
parameters = new {
projectName = "<projectName>",
deploymentName = "<deploymentName>",
},
kind = "Conversation",
};
Response response = client.AnalyzeConversation(RequestContent.Create(data));
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("kind").ToString());
This sample shows how to call AnalyzeConversation with all request content, and how to parse the result.
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new ConversationAnalysisClient(endpoint, credential);
var data = new {
analysisInput = new {
conversationItem = new {
text = "<text>",
id = "<id>",
participantId = "<participantId>",
language = "<language>",
modality = "transcript",
role = "agent",
},
},
parameters = new {
projectName = "<projectName>",
deploymentName = "<deploymentName>",
verbose = true,
isLoggingEnabled = true,
stringIndexType = "Utf16CodeUnit",
directTarget = "<directTarget>",
targetProjectParameters = new {
key = new {
query = "<query>",
callingOptions = new {
verbose = true,
log = true,
show_all_intents = true,
timezoneOffset = 123.45f,
spellCheck = true,
bing_spell_check_subscription_key = "<bing-spell-check-subscription-key>",
},
targetProjectKind = "Luis",
apiVersion = "<apiVersion>",
},
},
},
kind = "Conversation",
};
Response response = client.AnalyzeConversation(RequestContent.Create(data));
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("kind").ToString());
Remarks
Additional information can be found in the service REST API documentation: https://learn.microsoft.com/rest/api/language/2023-04-01/conversation-analysis-runtime/analyze-conversation
Applies to
Azure SDK for .NET
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin