Share via


ConversationAnalysisClient.AnalyzeConversationSubmitOperation Method

Definition

Overloads

AnalyzeConversationSubmitOperation(WaitUntil, AnalyzeConversationOperationInput, CancellationToken)

Analyzes the input conversation utterance.

AnalyzeConversationSubmitOperation(WaitUntil, RequestContent, RequestContext)

[Protocol Method] Analyzes the input conversation utterance.

AnalyzeConversationSubmitOperation(WaitUntil, AnalyzeConversationOperationInput, CancellationToken)

Source:
ConversationAnalysisClient.cs

Analyzes the input conversation utterance.

public virtual Azure.Operation AnalyzeConversationSubmitOperation (Azure.WaitUntil waitUntil, Azure.AI.Language.Conversations.Models.AnalyzeConversationOperationInput analyzeConversationOperationInput, System.Threading.CancellationToken cancellationToken = default);
abstract member AnalyzeConversationSubmitOperation : Azure.WaitUntil * Azure.AI.Language.Conversations.Models.AnalyzeConversationOperationInput * System.Threading.CancellationToken -> Azure.Operation
override this.AnalyzeConversationSubmitOperation : Azure.WaitUntil * Azure.AI.Language.Conversations.Models.AnalyzeConversationOperationInput * System.Threading.CancellationToken -> Azure.Operation
Public Overridable Function AnalyzeConversationSubmitOperation (waitUntil As WaitUntil, analyzeConversationOperationInput As AnalyzeConversationOperationInput, Optional cancellationToken As CancellationToken = Nothing) As 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 AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[]
{
    new TranscriptConversation("1", "en", new TranscriptConversationItem[]
    {
        new TranscriptConversationItem(
        "1",
        "1",
        "good morning john doe",
        "good morning john doe",
        "Good morning John Doe.",
        "good morning john doe")
        {
            WordLevelTimings = {new WordLevelTiming
            {
                Offset = 390000L,
                Duration = 2700000L,
                Word = "good",
            }, new WordLevelTiming
            {
                Offset = 4500000L,
                Duration = 920000L,
                Word = "morning",
            }, new WordLevelTiming
            {
                Offset = 590000L,
                Duration = 2700000L,
                Word = "john",
            }, new WordLevelTiming
            {
                Offset = 6300000L,
                Duration = 920000L,
                Word = "doe",
            }},
        }
    })
    {
        Domain = ConversationDomain.Generic,
    }
}), new AnalyzeConversationOperationAction[]
{
    new PiiOperationAction
    {
        ActionContent = new ConversationPiiActionContent
        {
            ModelVersion = "latest",
            PiiCategories = {ConversationPiiCategories.All},
            RedactAudioTiming = true,
            RedactionSource = TranscriptContentType.Lexical,
            RedactionPolicy = new CharacterMaskPolicyType
            {
                RedactionCharacter = RedactionCharacter.Minus,
            },
        },
        Name = "Conversation PII",
    }
})
{
    DisplayName = "Redacting PII data from transcribed audio",
};
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[]
{
    new TranscriptConversation("1", "en", new TranscriptConversationItem[]
    {
        new TranscriptConversationItem(
        "1",
        "1",
        "good morning john doe",
        "good morning john doe",
        "Good morning John Doe.",
        "good morning john doe")
        {
            WordLevelTimings = {new WordLevelTiming
            {
                Offset = 390000L,
                Duration = 2700000L,
                Word = "good",
            }, new WordLevelTiming
            {
                Offset = 4500000L,
                Duration = 920000L,
                Word = "morning",
            }, new WordLevelTiming
            {
                Offset = 590000L,
                Duration = 2700000L,
                Word = "john",
            }, new WordLevelTiming
            {
                Offset = 6300000L,
                Duration = 920000L,
                Word = "doe",
            }},
        }
    })
    {
        Domain = ConversationDomain.Generic,
    }
}), new AnalyzeConversationOperationAction[]
{
    new PiiOperationAction
    {
        ActionContent = new ConversationPiiActionContent
        {
            ModelVersion = "latest",
            PiiCategories = {ConversationPiiCategories.All},
            RedactAudioTiming = true,
            RedactionSource = TranscriptContentType.Lexical,
            RedactionPolicy = new EntityMaskTypePolicyType(),
        },
        Name = "Conversation PII",
    }
})
{
    DisplayName = "Redacting PII data from transcribed audio",
};
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[]
{
    new TranscriptConversation("1", "en", new TranscriptConversationItem[]
    {
        new TranscriptConversationItem(
        "1",
        "1",
        "good morning john doe",
        "good morning john doe",
        "Good morning John Doe.",
        "good morning john doe")
        {
            WordLevelTimings = {new WordLevelTiming
            {
                Offset = 390000L,
                Duration = 2700000L,
                Word = "good",
            }, new WordLevelTiming
            {
                Offset = 4500000L,
                Duration = 920000L,
                Word = "morning",
            }, new WordLevelTiming
            {
                Offset = 590000L,
                Duration = 2700000L,
                Word = "john",
            }, new WordLevelTiming
            {
                Offset = 6300000L,
                Duration = 920000L,
                Word = "doe",
            }},
        }
    })
    {
        Domain = ConversationDomain.Generic,
    }
}), new AnalyzeConversationOperationAction[]
{
    new PiiOperationAction
    {
        ActionContent = new ConversationPiiActionContent
        {
            ModelVersion = "latest",
            RedactAudioTiming = true,
            RedactionSource = TranscriptContentType.Lexical,
            ExcludePiiCategories = {ConversationPiiCategoryExclusions.Person},
        },
        Name = "Conversation PII",
    }
})
{
    DisplayName = "Redacting PII data from transcribed audio",
};
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[]
{
    new TranscriptConversation("1", "en", new TranscriptConversationItem[]
    {
        new TranscriptConversationItem(
        "1",
        "1",
        "good morning john doe",
        "good morning john doe",
        "Good morning John Doe.",
        "good morning john doe")
        {
            WordLevelTimings = {new WordLevelTiming
            {
                Offset = 390000L,
                Duration = 2700000L,
                Word = "good",
            }, new WordLevelTiming
            {
                Offset = 4500000L,
                Duration = 920000L,
                Word = "morning",
            }, new WordLevelTiming
            {
                Offset = 590000L,
                Duration = 2700000L,
                Word = "john",
            }, new WordLevelTiming
            {
                Offset = 6300000L,
                Duration = 920000L,
                Word = "doe",
            }},
        }
    })
    {
        Domain = ConversationDomain.Generic,
    }
}), new AnalyzeConversationOperationAction[]
{
    new PiiOperationAction
    {
        ActionContent = new ConversationPiiActionContent
        {
            ModelVersion = "latest",
            PiiCategories = {ConversationPiiCategories.All},
            RedactAudioTiming = true,
            RedactionSource = TranscriptContentType.Lexical,
            RedactionPolicy = new NoMaskPolicyType(),
        },
        Name = "Conversation PII",
    }
})
{
    DisplayName = "Redacting PII data from transcribed audio",
};
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[]
{
    new TranscriptConversation("1", "en", new TranscriptConversationItem[]
    {
        new TranscriptConversationItem(
        "1",
        "1",
        "good morning john doe",
        "good morning john doe",
        "Good morning John Doe.",
        "good morning john doe")
        {
            WordLevelTimings = {new WordLevelTiming
            {
                Offset = 390000L,
                Duration = 2700000L,
                Word = "good",
            }, new WordLevelTiming
            {
                Offset = 4500000L,
                Duration = 920000L,
                Word = "morning",
            }, new WordLevelTiming
            {
                Offset = 590000L,
                Duration = 2700000L,
                Word = "john",
            }, new WordLevelTiming
            {
                Offset = 6300000L,
                Duration = 920000L,
                Word = "doe",
            }},
        }
    })
    {
        Domain = ConversationDomain.Generic,
    }
}), new AnalyzeConversationOperationAction[]
{
    new PiiOperationAction
    {
        ActionContent = new ConversationPiiActionContent
        {
            ModelVersion = "latest",
            PiiCategories = {ConversationPiiCategories.All},
            RedactAudioTiming = true,
            RedactionSource = TranscriptContentType.Lexical,
            RedactionCharacter = RedactionCharacter.Minus,
        },
        Name = "Conversation PII",
    }
})
{
    DisplayName = "Redacting PII data from transcribed audio",
};
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[]
{
    new TranscriptConversation("1", "en", new TranscriptConversationItem[]
    {
        new TranscriptConversationItem(
        "1",
        "1",
        "good morning john doe",
        "good morning john doe",
        "Good morning John Doe.",
        "good morning john doe")
        {
            WordLevelTimings = {new WordLevelTiming
            {
                Offset = 390000L,
                Duration = 2700000L,
                Word = "good",
            }, new WordLevelTiming
            {
                Offset = 4500000L,
                Duration = 920000L,
                Word = "morning",
            }, new WordLevelTiming
            {
                Offset = 590000L,
                Duration = 2700000L,
                Word = "john",
            }, new WordLevelTiming
            {
                Offset = 6300000L,
                Duration = 920000L,
                Word = "doe",
            }},
        }
    })
    {
        Domain = ConversationDomain.Generic,
    }
}), new AnalyzeConversationOperationAction[]
{
    new PiiOperationAction
    {
        ActionContent = new ConversationPiiActionContent
        {
            ModelVersion = "latest",
            PiiCategories = {ConversationPiiCategories.All},
            RedactAudioTiming = true,
            RedactionSource = TranscriptContentType.Lexical,
        },
        Name = "Conversation PII",
    }
})
{
    DisplayName = "Redacting PII data from transcribed audio",
};
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[]
{
    new TranscriptConversation("1", "en", new TranscriptConversationItem[]
    {
        new TranscriptConversationItem(
        "1",
        "speaker 1",
        "",
        "",
        "Let's get started.",
        "")
        {
            ConversationItemLevelTiming = new ConversationItemLevelTiming
            {
                Offset = 0L,
                Duration = 20000000L,
            },
        },
        new TranscriptConversationItem(
        "2",
        "speaker 2",
        "",
        "",
        "OK. How many remaining bugs do we have now?",
        "")
        {
            ConversationItemLevelTiming = new ConversationItemLevelTiming
            {
                Offset = 20000000L,
                Duration = 50000000L,
            },
        },
        new TranscriptConversationItem(
        "3",
        "speaker 3",
        "",
        "",
        "Only 3.",
        "")
        {
            ConversationItemLevelTiming = new ConversationItemLevelTiming
            {
                Offset = 50000000L,
                Duration = 60000000L,
            },
        }
    })
}), new AnalyzeConversationOperationAction[]
{
    new SummarizationOperationAction
    {
        ActionContent = new ConversationSummarizationActionContent(new SummaryAspect[]{SummaryAspect.ChapterTitle, SummaryAspect.Narrative}),
        Name = "Conversation Summarization Task 1",
    }
})
{
    DisplayName = "Conversation Summarization Example",
};
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[]
{
    new TextConversation("20220101meeting", "en", new TextConversationItem[]
    {
        new TextConversationItem("1", "user", "Hi!")
        {
            Role = ParticipantRole.Customer,
        },
        new TextConversationItem("2", "agent", "Hello, how can I help you?")
        {
            Role = ParticipantRole.Agent,
        },
        new TextConversationItem("3", "user", "I am having trouble issuing a return of a game on my xbox: call of duty")
        {
            Role = ParticipantRole.Customer,
        }
    })
    {
        Domain = ConversationDomain.Generic,
    }
}), new AnalyzeConversationOperationAction[]
{
    new SummarizationOperationAction
    {
        ActionContent = new ConversationSummarizationActionContent(new SummaryAspect[]{SummaryAspect.Issue, SummaryAspect.Resolution})
        {
            ModelVersion = "latest",
        },
        Name = "analyze 1",
    }
})
{
    DisplayName = "Analyze conversations from Contoso meeting",
};
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[]
{
    new TranscriptConversation("1", "en", new TranscriptConversationItem[]
    {
        new TranscriptConversationItem(
        "1",
        "speaker 1",
        "",
        "",
        "Let's get started.",
        "")
        {
            ConversationItemLevelTiming = new ConversationItemLevelTiming
            {
                Offset = 0L,
                Duration = 20000000L,
            },
        },
        new TranscriptConversationItem(
        "2",
        "speaker 2",
        "",
        "",
        "OK. How many remaining bugs do we have now?",
        "")
        {
            ConversationItemLevelTiming = new ConversationItemLevelTiming
            {
                Offset = 20000000L,
                Duration = 50000000L,
            },
        },
        new TranscriptConversationItem(
        "3",
        "speaker 3",
        "",
        "",
        "Only 3.",
        "")
        {
            ConversationItemLevelTiming = new ConversationItemLevelTiming
            {
                Offset = 50000000L,
                Duration = 60000000L,
            },
        }
    })
}), new AnalyzeConversationOperationAction[]
{
    new CustomSummarizationOperationAction
    {
        ActionContent = new CustomConversationSummarizationActionContent("my_project", "my_deployment", new SummaryAspect[]{SummaryAspect.Narrative}),
        Name = "Custom Conversation Summarization Task 1",
    }
})
{
    DisplayName = "Custom Conversation Summarization Example",
};
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput);

Applies to

AnalyzeConversationSubmitOperation(WaitUntil, RequestContent, RequestContext)

Source:
ConversationAnalysisClient.cs

[Protocol Method] Analyzes the input conversation utterance.

public virtual Azure.Operation AnalyzeConversationSubmitOperation (Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member AnalyzeConversationSubmitOperation : Azure.WaitUntil * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Operation
override this.AnalyzeConversationSubmitOperation : Azure.WaitUntil * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Operation
Public Overridable Function AnalyzeConversationSubmitOperation (waitUntil As WaitUntil, content As RequestContent, Optional context As RequestContext = Nothing) As 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 AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
    displayName = "Redacting PII data from transcribed audio",
    analysisInput = new
    {
        conversations = new object[]
        {
            new
            {
                id = "1",
                language = "en",
                modality = "transcript",
                domain = "generic",
                conversationItems = new object[]
                {
                    new
                    {
                        participantId = "1",
                        id = "1",
                        text = "Good morning John Doe.",
                        itn = "good morning john doe",
                        maskedItn = "good morning john doe",
                        lexical = "good morning john doe",
                        wordLevelTimings = new object[]
                        {
                            new
                            {
                                word = "good",
                                offset = 390000L,
                                duration = 2700000L,
                            },
                            new
                            {
                                word = "morning",
                                offset = 4500000L,
                                duration = 920000L,
                            },
                            new
                            {
                                word = "john",
                                offset = 590000L,
                                duration = 2700000L,
                            },
                            new
                            {
                                word = "doe",
                                offset = 6300000L,
                                duration = 920000L,
                            }
                        },
                    }
                },
            }
        },
    },
    tasks = new object[]
    {
        new
        {
            taskName = "Conversation PII",
            kind = "ConversationalPIITask",
            parameters = new
            {
                modelVersion = "latest",
                piiCategories = new object[]
                {
                    "All"
                },
                redactionPolicy = new
                {
                    policyKind = "characterMask",
                    redactionCharacter = "-",
                },
                redactionSource = "lexical",
                redactAudioTiming = true,
            },
        }
    },
});
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
    displayName = "Redacting PII data from transcribed audio",
    analysisInput = new
    {
        conversations = new object[]
        {
            new
            {
                id = "1",
                language = "en",
                modality = "transcript",
                domain = "generic",
                conversationItems = new object[]
                {
                    new
                    {
                        participantId = "1",
                        id = "1",
                        text = "Good morning John Doe.",
                        itn = "good morning john doe",
                        maskedItn = "good morning john doe",
                        lexical = "good morning john doe",
                        wordLevelTimings = new object[]
                        {
                            new
                            {
                                word = "good",
                                offset = 390000L,
                                duration = 2700000L,
                            },
                            new
                            {
                                word = "morning",
                                offset = 4500000L,
                                duration = 920000L,
                            },
                            new
                            {
                                word = "john",
                                offset = 590000L,
                                duration = 2700000L,
                            },
                            new
                            {
                                word = "doe",
                                offset = 6300000L,
                                duration = 920000L,
                            }
                        },
                    }
                },
            }
        },
    },
    tasks = new object[]
    {
        new
        {
            taskName = "Conversation PII",
            kind = "ConversationalPIITask",
            parameters = new
            {
                modelVersion = "latest",
                piiCategories = new object[]
                {
                    "All"
                },
                redactionPolicy = new
                {
                    policyKind = "entityMask",
                },
                redactionSource = "lexical",
                redactAudioTiming = true,
            },
        }
    },
});
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
    displayName = "Redacting PII data from transcribed audio",
    analysisInput = new
    {
        conversations = new object[]
        {
            new
            {
                id = "1",
                language = "en",
                modality = "transcript",
                domain = "generic",
                conversationItems = new object[]
                {
                    new
                    {
                        participantId = "1",
                        id = "1",
                        text = "Good morning John Doe.",
                        itn = "good morning john doe",
                        maskedItn = "good morning john doe",
                        lexical = "good morning john doe",
                        wordLevelTimings = new object[]
                        {
                            new
                            {
                                word = "good",
                                offset = 390000L,
                                duration = 2700000L,
                            },
                            new
                            {
                                word = "morning",
                                offset = 4500000L,
                                duration = 920000L,
                            },
                            new
                            {
                                word = "john",
                                offset = 590000L,
                                duration = 2700000L,
                            },
                            new
                            {
                                word = "doe",
                                offset = 6300000L,
                                duration = 920000L,
                            }
                        },
                    }
                },
            }
        },
    },
    tasks = new object[]
    {
        new
        {
            taskName = "Conversation PII",
            kind = "ConversationalPIITask",
            parameters = new
            {
                modelVersion = "latest",
                excludePiiCategories = new object[]
                {
                    "Person"
                },
                redactionSource = "lexical",
                redactAudioTiming = true,
            },
        }
    },
});
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
    displayName = "Redacting PII data from transcribed audio",
    analysisInput = new
    {
        conversations = new object[]
        {
            new
            {
                id = "1",
                language = "en",
                modality = "transcript",
                domain = "generic",
                conversationItems = new object[]
                {
                    new
                    {
                        participantId = "1",
                        id = "1",
                        text = "Good morning John Doe.",
                        itn = "good morning john doe",
                        maskedItn = "good morning john doe",
                        lexical = "good morning john doe",
                        wordLevelTimings = new object[]
                        {
                            new
                            {
                                word = "good",
                                offset = 390000L,
                                duration = 2700000L,
                            },
                            new
                            {
                                word = "morning",
                                offset = 4500000L,
                                duration = 920000L,
                            },
                            new
                            {
                                word = "john",
                                offset = 590000L,
                                duration = 2700000L,
                            },
                            new
                            {
                                word = "doe",
                                offset = 6300000L,
                                duration = 920000L,
                            }
                        },
                    }
                },
            }
        },
    },
    tasks = new object[]
    {
        new
        {
            taskName = "Conversation PII",
            kind = "ConversationalPIITask",
            parameters = new
            {
                modelVersion = "latest",
                piiCategories = new object[]
                {
                    "All"
                },
                redactionPolicy = new
                {
                    policyKind = "noMask",
                },
                redactionSource = "lexical",
                redactAudioTiming = true,
            },
        }
    },
});
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
    displayName = "Redacting PII data from transcribed audio",
    analysisInput = new
    {
        conversations = new object[]
        {
            new
            {
                id = "1",
                language = "en",
                modality = "transcript",
                domain = "generic",
                conversationItems = new object[]
                {
                    new
                    {
                        participantId = "1",
                        id = "1",
                        text = "Good morning John Doe.",
                        itn = "good morning john doe",
                        maskedItn = "good morning john doe",
                        lexical = "good morning john doe",
                        wordLevelTimings = new object[]
                        {
                            new
                            {
                                word = "good",
                                offset = 390000L,
                                duration = 2700000L,
                            },
                            new
                            {
                                word = "morning",
                                offset = 4500000L,
                                duration = 920000L,
                            },
                            new
                            {
                                word = "john",
                                offset = 590000L,
                                duration = 2700000L,
                            },
                            new
                            {
                                word = "doe",
                                offset = 6300000L,
                                duration = 920000L,
                            }
                        },
                    }
                },
            }
        },
    },
    tasks = new object[]
    {
        new
        {
            taskName = "Conversation PII",
            kind = "ConversationalPIITask",
            parameters = new
            {
                modelVersion = "latest",
                piiCategories = new object[]
                {
                    "All"
                },
                redactionCharacter = "-",
                redactionSource = "lexical",
                redactAudioTiming = true,
            },
        }
    },
});
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
    displayName = "Redacting PII data from transcribed audio",
    analysisInput = new
    {
        conversations = new object[]
        {
            new
            {
                id = "1",
                language = "en",
                modality = "transcript",
                domain = "generic",
                conversationItems = new object[]
                {
                    new
                    {
                        participantId = "1",
                        id = "1",
                        text = "Good morning John Doe.",
                        itn = "good morning john doe",
                        maskedItn = "good morning john doe",
                        lexical = "good morning john doe",
                        wordLevelTimings = new object[]
                        {
                            new
                            {
                                word = "good",
                                offset = 390000L,
                                duration = 2700000L,
                            },
                            new
                            {
                                word = "morning",
                                offset = 4500000L,
                                duration = 920000L,
                            },
                            new
                            {
                                word = "john",
                                offset = 590000L,
                                duration = 2700000L,
                            },
                            new
                            {
                                word = "doe",
                                offset = 6300000L,
                                duration = 920000L,
                            }
                        },
                    }
                },
            }
        },
    },
    tasks = new object[]
    {
        new
        {
            taskName = "Conversation PII",
            kind = "ConversationalPIITask",
            parameters = new
            {
                modelVersion = "latest",
                piiCategories = new object[]
                {
                    "All"
                },
                redactionSource = "lexical",
                redactAudioTiming = true,
            },
        }
    },
});
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
    displayName = "Conversation Summarization Example",
    analysisInput = new
    {
        conversations = new object[]
        {
            new
            {
                id = "1",
                language = "en",
                modality = "transcript",
                conversationItems = new object[]
                {
                    new
                    {
                        participantId = "speaker 1",
                        id = "1",
                        text = "Let's get started.",
                        lexical = "",
                        itn = "",
                        maskedItn = "",
                        conversationItemLevelTiming = new
                        {
                            offset = 0L,
                            duration = 20000000L,
                        },
                    },
                    new
                    {
                        participantId = "speaker 2",
                        id = "2",
                        text = "OK. How many remaining bugs do we have now?",
                        lexical = "",
                        itn = "",
                        maskedItn = "",
                        conversationItemLevelTiming = new
                        {
                            offset = 20000000L,
                            duration = 50000000L,
                        },
                    },
                    new
                    {
                        participantId = "speaker 3",
                        id = "3",
                        text = "Only 3.",
                        lexical = "",
                        itn = "",
                        maskedItn = "",
                        conversationItemLevelTiming = new
                        {
                            offset = 50000000L,
                            duration = 60000000L,
                        },
                    }
                },
            }
        },
    },
    tasks = new object[]
    {
        new
        {
            taskName = "Conversation Summarization Task 1",
            kind = "ConversationalSummarizationTask",
            parameters = new
            {
                summaryAspects = new object[]
                {
                    "chapterTitle",
                    "narrative"
                },
            },
        }
    },
});
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
    displayName = "Analyze conversations from Contoso meeting",
    analysisInput = new
    {
        conversations = new object[]
        {
            new
            {
                id = "20220101meeting",
                language = "en",
                modality = "text",
                domain = "generic",
                conversationItems = new object[]
                {
                    new
                    {
                        participantId = "user",
                        role = "customer",
                        id = "1",
                        text = "Hi!",
                    },
                    new
                    {
                        participantId = "agent",
                        role = "agent",
                        id = "2",
                        text = "Hello, how can I help you?",
                    },
                    new
                    {
                        participantId = "user",
                        role = "customer",
                        id = "3",
                        text = "I am having trouble issuing a return of a game on my xbox: call of duty",
                    }
                },
            }
        },
    },
    tasks = new object[]
    {
        new
        {
            taskName = "analyze 1",
            kind = "ConversationalSummarizationTask",
            parameters = new
            {
                modelVersion = "latest",
                summaryAspects = new object[]
                {
                    "issue",
                    "resolution"
                },
            },
        }
    },
});
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content);

This sample shows how to call AnalyzeConversationSubmitOperation.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential);

using RequestContent content = RequestContent.Create(new
{
    displayName = "Custom Conversation Summarization Example",
    analysisInput = new
    {
        conversations = new object[]
        {
            new
            {
                id = "1",
                language = "en",
                modality = "transcript",
                conversationItems = new object[]
                {
                    new
                    {
                        participantId = "speaker 1",
                        id = "1",
                        text = "Let's get started.",
                        lexical = "",
                        itn = "",
                        maskedItn = "",
                        conversationItemLevelTiming = new
                        {
                            offset = 0L,
                            duration = 20000000L,
                        },
                    },
                    new
                    {
                        participantId = "speaker 2",
                        id = "2",
                        text = "OK. How many remaining bugs do we have now?",
                        lexical = "",
                        itn = "",
                        maskedItn = "",
                        conversationItemLevelTiming = new
                        {
                            offset = 20000000L,
                            duration = 50000000L,
                        },
                    },
                    new
                    {
                        participantId = "speaker 3",
                        id = "3",
                        text = "Only 3.",
                        lexical = "",
                        itn = "",
                        maskedItn = "",
                        conversationItemLevelTiming = new
                        {
                            offset = 50000000L,
                            duration = 60000000L,
                        },
                    }
                },
            }
        },
    },
    tasks = new object[]
    {
        new
        {
            taskName = "Custom Conversation Summarization Task 1",
            kind = "CustomConversationalSummarizationTask",
            parameters = new
            {
                summaryAspects = new object[]
                {
                    "narrative"
                },
                projectName = "my_project",
                deploymentName = "my_deployment",
            },
        }
    },
});
Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content);

Applies to