Udostępnij za pośrednictwem


ConversationAnalysisClient.GetAnalyzeConversationJobStatusAsync Method

Definition

Overloads

GetAnalyzeConversationJobStatusAsync(Guid, Nullable<Boolean>, RequestContext)

[Protocol Method] Get analysis status and results

GetAnalyzeConversationJobStatusAsync(Guid, Nullable<Boolean>, CancellationToken)

Get analysis status and results.

GetAnalyzeConversationJobStatusAsync(Guid, Nullable<Boolean>, RequestContext)

Source:
ConversationAnalysisClient.cs
Source:
ConversationAnalysisClient.cs

[Protocol Method] Get analysis status and results

public virtual System.Threading.Tasks.Task<Azure.Response> GetAnalyzeConversationJobStatusAsync (Guid jobId, bool? showStats = default, Azure.RequestContext context = default);
public virtual System.Threading.Tasks.Task<Azure.Response> GetAnalyzeConversationJobStatusAsync (Guid jobId, bool? showStatistics, Azure.RequestContext context);
abstract member GetAnalyzeConversationJobStatusAsync : Guid * Nullable<bool> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetAnalyzeConversationJobStatusAsync : Guid * Nullable<bool> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
abstract member GetAnalyzeConversationJobStatusAsync : Guid * Nullable<bool> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetAnalyzeConversationJobStatusAsync : Guid * Nullable<bool> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetAnalyzeConversationJobStatusAsync (jobId As Guid, Optional showStats As Nullable(Of Boolean) = Nothing, Optional context As RequestContext = Nothing) As Task(Of Response)
Public Overridable Function GetAnalyzeConversationJobStatusAsync (jobId As Guid, showStatistics As Nullable(Of Boolean), context As RequestContext) As Task(Of Response)

Parameters

jobId
Guid

job ID.

showStatsshowStatistics
Nullable<Boolean>

(Optional) if set to true, response will contain request and document level statistics.

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

Service returned a non-success status code.

Examples

This sample shows how to call GetAnalyzeConversationJobStatusAsync and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString());

This sample shows how to call GetAnalyzeConversationJobStatusAsync with all parameters and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), true, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("nextLink").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("lastUpdateDateTime").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("taskName").ToString());
Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("kind").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("documentsCount").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("validDocumentsCount").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousDocumentsCount").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("transactionsCount").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("conversationsCount").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("validConversationsCount").ToString());
Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousConversationsCount").ToString());

Remarks

Additional information can be found in the service REST API documentation: https://learn.microsoft.com/rest/api/language/2023-04-01/analyze-conversation/job-status

Applies to

GetAnalyzeConversationJobStatusAsync(Guid, Nullable<Boolean>, CancellationToken)

Source:
ConversationAnalysisClient.cs

Get analysis status and results.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.Conversations.Models.AnalyzeConversationOperationState>> GetAnalyzeConversationJobStatusAsync (Guid jobId, bool? showStatistics = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAnalyzeConversationJobStatusAsync : Guid * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.Conversations.Models.AnalyzeConversationOperationState>>
override this.GetAnalyzeConversationJobStatusAsync : Guid * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Language.Conversations.Models.AnalyzeConversationOperationState>>
Public Overridable Function GetAnalyzeConversationJobStatusAsync (jobId As Guid, Optional showStatistics As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AnalyzeConversationOperationState))

Parameters

jobId
Guid

job ID.

showStatistics
Nullable<Boolean>

(Optional) if set to true, response will contain request and document level statistics.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetAnalyzeConversationJobStatusAsync.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

Response<AnalyzeConversationOperationState> response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"));

This sample shows how to call GetAnalyzeConversationJobStatusAsync with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

Response<AnalyzeConversationOperationState> response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), showStatistics: true);

Remarks

Get the status of an analysis job. A job can consist of one or more tasks. After all tasks succeed, the job transitions to the succeeded state and results are available for each task.

Applies to