Compartilhar via


ConversationAnalysisClient.GetAnalyzeConversationJobStatus Método

Definição

[Método de protocolo] Obter status de análise e resultados

  • Esse método de protocolo permite a criação explícita da solicitação e do processamento da resposta para cenários avançados.
public virtual Azure.Response GetAnalyzeConversationJobStatus (Guid jobId, bool? showStats = default, Azure.RequestContext context = default);
abstract member GetAnalyzeConversationJobStatus : Guid * Nullable<bool> * Azure.RequestContext -> Azure.Response
override this.GetAnalyzeConversationJobStatus : Guid * Nullable<bool> * Azure.RequestContext -> Azure.Response
Public Overridable Function GetAnalyzeConversationJobStatus (jobId As Guid, Optional showStats As Nullable(Of Boolean) = Nothing, Optional context As RequestContext = Nothing) As Response

Parâmetros

jobId
Guid

ID do trabalho.

showStats
Nullable<Boolean>

(Opcional) se definido como true, a resposta conterá estatísticas de nível de solicitação e documento.

context
RequestContext

O contexto de solicitação, que pode substituir os comportamentos padrão do pipeline do cliente por chamada.

Retornos

A resposta retornada do serviço.

Exceções

O serviço retornou um código de status sem êxito.

Exemplos

Este exemplo mostra como chamar GetAnalyzeConversationJobStatus com os parâmetros necessários e analisar o resultado.

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

Response response = client.GetAnalyzeConversationJobStatus(Guid.NewGuid());

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());

Este exemplo mostra como chamar GetAnalyzeConversationJobStatus com todos os parâmetros e como analisar o resultado.

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

Response response = client.GetAnalyzeConversationJobStatus(Guid.NewGuid(), true);

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("details")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("<test>").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").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("<test>").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("nextLink").ToString());

Comentários

Informações adicionais podem ser encontradas na documentação da API REST do serviço: https://learn.microsoft.com/rest/api/language/2023-04-01/analyze-conversation/job-status

Aplica-se a