ConversationAnalysisClient.AnalyzeConversationAsync 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 System.Threading.Tasks.Task<Azure.Response> AnalyzeConversationAsync (Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member AnalyzeConversationAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.AnalyzeConversationAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function AnalyzeConversationAsync (content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of 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 AnalyzeConversationAsync 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 = await client.AnalyzeConversationAsync(RequestContent.Create(data));
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("kind").ToString());
This sample shows how to call AnalyzeConversationAsync 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 = await client.AnalyzeConversationAsync(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
Váš názor
https://aka.ms/ContentUserFeedback.
Připravujeme: V průběhu roku 2024 budeme postupně vyřazovat problémy z GitHub coby mechanismus zpětné vazby pro obsah a nahrazovat ho novým systémem zpětné vazby. Další informace naleznete v tématu:Odeslat a zobrazit názory pro