ConversationThreadClient.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.
Overloads
AnalyzeConversationAsync(String, RequestContext) |
[Protocol Method] Get AI Analysis of a conversation.
|
AnalyzeConversationAsync(String, CancellationToken) |
Get AI Analysis of a conversation. |
AnalyzeConversationAsync(String, RequestContext)
- Source:
- ConversationThreadClient.cs
[Protocol Method] Get AI Analysis of a conversation.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler AnalyzeConversationAsync(String, CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Response> AnalyzeConversationAsync(string conversationId, Azure.RequestContext context);
abstract member AnalyzeConversationAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.AnalyzeConversationAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function AnalyzeConversationAsync (conversationId As String, context As RequestContext) As Task(Of Response)
Parameters
- conversationId
- String
The conversation ID.
- 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
conversationId
is null.
conversationId
is an empty string, and was expected to be non-empty.
Service returned a non-success status code.
Examples
This sample shows how to call AnalyzeConversationAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConversationThreadClient client = new ConversationThreadClient(endpoint, credential);
Response response = await client.AnalyzeConversationAsync("<conversationId>", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("summary").ToString());
This sample shows how to call AnalyzeConversationAsync with all parameters and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConversationThreadClient client = new ConversationThreadClient(endpoint, credential);
Response response = await client.AnalyzeConversationAsync("<conversationId>", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("summary").ToString());
Applies to
AnalyzeConversationAsync(String, CancellationToken)
- Source:
- ConversationThreadClient.cs
Get AI Analysis of a conversation.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.Messages.GetConversationThreadAnalysisResult>> AnalyzeConversationAsync(string conversationId, System.Threading.CancellationToken cancellationToken = default);
abstract member AnalyzeConversationAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Communication.Messages.GetConversationThreadAnalysisResult>>
override this.AnalyzeConversationAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Communication.Messages.GetConversationThreadAnalysisResult>>
Public Overridable Function AnalyzeConversationAsync (conversationId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of GetConversationThreadAnalysisResult))
Parameters
- conversationId
- String
The conversation ID.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
conversationId
is null.
conversationId
is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call AnalyzeConversationAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConversationThreadClient client = new ConversationThreadClient(endpoint, credential);
Response<GetConversationThreadAnalysisResult> response = await client.AnalyzeConversationAsync("<conversationId>");
This sample shows how to call AnalyzeConversationAsync with all parameters.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConversationThreadClient client = new ConversationThreadClient(endpoint, credential);
Response<GetConversationThreadAnalysisResult> response = await client.AnalyzeConversationAsync("<conversationId>");