ConversationThreadClient.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.
Overloads
AnalyzeConversation(String, RequestContext) |
[Protocol Method] Get AI Analysis of a conversation.
|
AnalyzeConversation(String, CancellationToken) |
Get AI Analysis of a conversation. |
AnalyzeConversation(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 AnalyzeConversation(String, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response AnalyzeConversation(string conversationId, Azure.RequestContext context);
abstract member AnalyzeConversation : string * Azure.RequestContext -> Azure.Response
override this.AnalyzeConversation : string * Azure.RequestContext -> Azure.Response
Public Overridable Function AnalyzeConversation (conversationId As String, context As RequestContext) As 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 AnalyzeConversation and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConversationThreadClient client = new ConversationThreadClient(endpoint, credential);
Response response = client.AnalyzeConversation("<conversationId>", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("summary").ToString());
This sample shows how to call AnalyzeConversation with all parameters and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConversationThreadClient client = new ConversationThreadClient(endpoint, credential);
Response response = client.AnalyzeConversation("<conversationId>", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("summary").ToString());
Applies to
AnalyzeConversation(String, CancellationToken)
- Source:
- ConversationThreadClient.cs
Get AI Analysis of a conversation.
public virtual Azure.Response<Azure.Communication.Messages.GetConversationThreadAnalysisResult> AnalyzeConversation(string conversationId, System.Threading.CancellationToken cancellationToken = default);
abstract member AnalyzeConversation : string * System.Threading.CancellationToken -> Azure.Response<Azure.Communication.Messages.GetConversationThreadAnalysisResult>
override this.AnalyzeConversation : string * System.Threading.CancellationToken -> Azure.Response<Azure.Communication.Messages.GetConversationThreadAnalysisResult>
Public Overridable Function AnalyzeConversation (conversationId As String, Optional cancellationToken As CancellationToken = Nothing) As 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 AnalyzeConversation.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConversationThreadClient client = new ConversationThreadClient(endpoint, credential);
Response<GetConversationThreadAnalysisResult> response = client.AnalyzeConversation("<conversationId>");
This sample shows how to call AnalyzeConversation with all parameters.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConversationThreadClient client = new ConversationThreadClient(endpoint, credential);
Response<GetConversationThreadAnalysisResult> response = client.AnalyzeConversation("<conversationId>");