Share via


ConversationAnalysisClient class

A client for interacting with the conversational language understanding features in Azure Cognitive Language Service.

The client needs the endpoint of a Language resource and an authentication method such as an API key or AAD. The API key and endpoint can be found in the Language resource page in the Azure portal. They will be located in the resource's Keys and Endpoint page, under Resource Management.

Examples for authentication:

API Key

import { AzureKeyCredential } from "@azure/core-auth";
import { ConversationAnalysisClient } from "@azure/ai-language-conversations";

const endpoint = "https://<resource name>.cognitiveservices.azure.com";
const credential = new AzureKeyCredential("<api key>");

const client = new ConversationAnalysisClient(endpoint, credential);

Azure Active Directory

See the @azure/identity package for more information about authenticating with Azure Active Directory.

import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
import { DefaultAzureCredential } from "@azure/identity";

const endpoint = "https://<resource name>.cognitiveservices.azure.com";
const credential = new DefaultAzureCredential();

const client = new ConversationAnalysisClient(endpoint, credential);

Constructors

ConversationAnalysisClient(string, TokenCredential | KeyCredential, ConversationAnalysisClientOptionalParams)

Initializes a new instance of the ConversationAnalysisClient class.

Methods

analyzeConversation(ConversationalTask, AnalyzeConversationOptionalParams)

Analyzes the input conversation utterance.

beginConversationAnalysis(AnalyzeConversationJobsInput, ConversationAnalysisOptionalParams)

Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.

Constructor Details

ConversationAnalysisClient(string, TokenCredential | KeyCredential, ConversationAnalysisClientOptionalParams)

Initializes a new instance of the ConversationAnalysisClient class.

new ConversationAnalysisClient(endpoint: string, credential: TokenCredential | KeyCredential, options?: ConversationAnalysisClientOptionalParams)

Parameters

endpoint

string

Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com).

options
ConversationAnalysisClientOptionalParams

The parameter options

Method Details

analyzeConversation(ConversationalTask, AnalyzeConversationOptionalParams)

Analyzes the input conversation utterance.

function analyzeConversation(task: ConversationalTask, options?: AnalyzeConversationOptionalParams): Promise<ConversationalTaskResult>

Parameters

task
ConversationalTask

A single conversational task to execute.

options
AnalyzeConversationOptionalParams

The options parameters.

Returns

beginConversationAnalysis(AnalyzeConversationJobsInput, ConversationAnalysisOptionalParams)

Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.

function beginConversationAnalysis(task: AnalyzeConversationJobsInput, options?: ConversationAnalysisOptionalParams): Promise<PollerLike<PollOperationState<AnalyzeConversationJobState>, AnalyzeConversationJobState>>

Parameters

task
AnalyzeConversationJobsInput

The collection of conversations to analyze and one or more tasks to execute.

options
ConversationAnalysisOptionalParams

The options parameters.

Returns

Promise<PollerLike<@azure/core-lro.PollOperationState<AnalyzeConversationJobState>, AnalyzeConversationJobState>>