Share via


ConversationAnalysisClient.AnalyzeConversationSubmitOperationAsync Method

Definition

Overloads

AnalyzeConversationSubmitOperationAsync(WaitUntil, AnalyzeConversationOperationInput, CancellationToken)

Analyzes the input conversation utterance.

AnalyzeConversationSubmitOperationAsync(WaitUntil, RequestContent, RequestContext)

[Protocol Method] Analyzes the input conversation utterance.

AnalyzeConversationSubmitOperationAsync(WaitUntil, AnalyzeConversationOperationInput, CancellationToken)

Source:
ConversationAnalysisClient.cs

Analyzes the input conversation utterance.

public virtual System.Threading.Tasks.Task<Azure.Operation> AnalyzeConversationSubmitOperationAsync (Azure.WaitUntil waitUntil, Azure.AI.Language.Conversations.Models.AnalyzeConversationOperationInput analyzeConversationOperationInput, System.Threading.CancellationToken cancellationToken = default);
abstract member AnalyzeConversationSubmitOperationAsync : Azure.WaitUntil * Azure.AI.Language.Conversations.Models.AnalyzeConversationOperationInput * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Operation>
override this.AnalyzeConversationSubmitOperationAsync : Azure.WaitUntil * Azure.AI.Language.Conversations.Models.AnalyzeConversationOperationInput * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Operation>
Public Overridable Function AnalyzeConversationSubmitOperationAsync (waitUntil As WaitUntil, analyzeConversationOperationInput As AnalyzeConversationOperationInput, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Operation)

Parameters

waitUntil
WaitUntil

Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

analyzeConversationOperationInput
AnalyzeConversationOperationInput

The input for the analyze conversations operation.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

analyzeConversationOperationInput is null.

Examples

This sample shows how to call AnalyzeConversationSubmitOperationAsync.

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

AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[]
{
    new TextConversation("<id>", "<language>", new TextConversationItem[]
    {
        new TextConversationItem("<id>", "<participantId>", "<text>")
    })
}), new AnalyzeConversationOperationAction[]
{
    new PiiOperationAction()
});
Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput);

This sample shows how to call AnalyzeConversationSubmitOperationAsync with all parameters.

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

AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[]
{
    new TextConversation("<id>", "<language>", new TextConversationItem[]
    {
        new TextConversationItem("<id>", "<participantId>", "<text>")
        {
            Language = "<language>",
            Modality = InputModality.Transcript,
            Role = ParticipantRole.Customer,
        }
    })
    {
        Domain = ConversationDomain.Finance,
    }
}), new AnalyzeConversationOperationAction[]
{
    new PiiOperationAction
    {
        ActionContent = new ConversationPiiActionContent
        {
            LoggingOptOut = true,
            ModelVersion = "<modelVersion>",
            PiiCategories = {ConversationPiiCategories.Address},
            RedactAudioTiming = true,
            RedactionSource = TranscriptContentType.Lexical,
            RedactionCharacter = RedactionCharacter.ExclamationPoint,
            ExcludePiiCategories = {ConversationPiiCategoryExclusions.Address},
        },
        Name = "<taskName>",
    }
})
{
    DisplayName = "<displayName>",
};
Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput);

Applies to

AnalyzeConversationSubmitOperationAsync(WaitUntil, RequestContent, RequestContext)

Source:
ConversationAnalysisClient.cs

[Protocol Method] Analyzes the input conversation utterance.

public virtual System.Threading.Tasks.Task<Azure.Operation> AnalyzeConversationSubmitOperationAsync (Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member AnalyzeConversationSubmitOperationAsync : Azure.WaitUntil * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation>
override this.AnalyzeConversationSubmitOperationAsync : Azure.WaitUntil * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation>
Public Overridable Function AnalyzeConversationSubmitOperationAsync (waitUntil As WaitUntil, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Operation)

Parameters

waitUntil
WaitUntil

Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

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 Operation representing an asynchronous operation on the service.

Exceptions

content is null.

Service returned a non-success status code.

Examples

This sample shows how to call AnalyzeConversationSubmitOperationAsync.

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

using RequestContent content = RequestContent.Create(new
{
    analysisInput = new
    {
        conversations = new object[]
        {
            new
            {
                modality = "text",
                conversationItems = new object[]
                {
                    new
                    {
                        id = "<id>",
                        participantId = "<participantId>",
                        text = "<text>",
                    }
                },
                id = "<id>",
                language = "<language>",
            }
        },
    },
    tasks = new object[]
    {
        new
        {
            kind = "ConversationalPIITask",
        }
    },
});
Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content);

This sample shows how to call AnalyzeConversationSubmitOperationAsync with all parameters and request content.

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

using RequestContent content = RequestContent.Create(new
{
    displayName = "<displayName>",
    analysisInput = new
    {
        conversations = new object[]
        {
            new
            {
                modality = "text",
                conversationItems = new object[]
                {
                    new
                    {
                        id = "<id>",
                        participantId = "<participantId>",
                        language = "<language>",
                        modality = "transcript",
                        role = "customer",
                        text = "<text>",
                    }
                },
                id = "<id>",
                language = "<language>",
                domain = "finance",
            }
        },
    },
    tasks = new object[]
    {
        new
        {
            kind = "ConversationalPIITask",
            parameters = new
            {
                loggingOptOut = true,
                modelVersion = "<modelVersion>",
                piiCategories = new object[]
                {
                    "Address"
                },
                redactAudioTiming = true,
                redactionSource = "lexical",
                redactionCharacter = "!",
                excludePiiCategories = new object[]
                {
                    "Address"
                },
            },
            taskName = "<taskName>",
        }
    },
});
Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content);

Applies to