QnAMaker Class
- java.
lang. Object - com.
microsoft. bot. ai. qna. QnAMaker
- com.
Implements
public class QnAMaker
implements QnAMakerClient, TelemetryQnAMaker
Provides access to a QnA Maker knowledge base.
Field Summary
| Modifier and Type | Field and Description |
|---|---|
| static final java.lang.String |
QNA_MAKER_NAME
The name of the Qn |
| static final java.lang.String |
QNA_MAKER_TRACE_LABEL
The label used when logging QnA Maker trace. |
| static final java.lang.String |
QNA_MAKER_TRACE_TYPE
The type used when logging QnA Maker trace. |
Constructor Summary
| Constructor | Description |
|---|---|
| QnAMaker(QnAMakerEndpoint withEndpoint, QnAMakerOptions options) |
Initializes a new instance of the QnAMaker class. |
| QnAMaker(QnAMakerEndpoint withEndpoint, QnAMakerOptions options, BotTelemetryClient withTelemetryClient, Boolean withLogPersonalInformation) |
Initializes a new instance of the Qn |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| java.util.concurrent.CompletableFuture<java.lang.Void> |
callTrain(FeedbackRecords feedbackRecords)
Send feedback to the knowledge base. |
| protected java.util.concurrent.CompletableFuture<Pair<java.util.Map<java.lang.String,java.lang.String>,java.util.Map<java.lang.String,java.lang.Double>>> |
fillQnAEvent(QueryResult[] queryResults, TurnContext turnContext, Map<String,String> telemetryProperties, Map<String,Double> telemetryMetrics)
Fills the event properties and metrics for the Qna |
|
java.util.concurrent.CompletableFuture<Query |
getAnswers(TurnContext turnContext, QnAMakerOptions options)
Generates an answer from the knowledge base. |
|
java.util.concurrent.CompletableFuture<Query |
getAnswers(TurnContext turnContext, QnAMakerOptions options, Map<String,String> telemetryProperties, Map<String,Double> telemetryMetrics)
Generates an answer from the knowledge base. |
|
java.util.concurrent.CompletableFuture<Query |
getAnswersRaw(TurnContext turnContext, QnAMakerOptions options, Map<String,String> telemetryProperties, Map<String,Double> telemetryMetrics)
Generates an answer from the knowledge base. |
| java.lang.Boolean |
getLogPersonalInformation()
Gets a value indicating whether determines whether to log personal information that came from the user. |
|
Query |
getLowScoreVariation(QueryResult[] queryResult)
Filters the ambiguous question for active learning. |
|
Bot |
getTelemetryClient()
Gets the currently configured BotTelemetryClient. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onQnaResults(QueryResult[] queryResults, TurnContext turnContext, Map<String,String> telemetryProperties, Map<String,Double> telemetryMetrics)
Executed when a result is returned from QnA Maker. |
Methods inherited from java.lang.Object
Field Details
QNA_MAKER_NAME
public static final String QNA_MAKER_NAME
The name of the QnAMaker class.
QNA_MAKER_TRACE_LABEL
public static final String QNA_MAKER_TRACE_LABEL
The label used when logging QnA Maker trace.
QNA_MAKER_TRACE_TYPE
public static final String QNA_MAKER_TRACE_TYPE
The type used when logging QnA Maker trace.
Constructor Details
QnAMaker
public QnAMaker(QnAMakerEndpoint withEndpoint, QnAMakerOptions options)
Initializes a new instance of the QnAMaker class.
Parameters:
QnAMaker
public QnAMaker(QnAMakerEndpoint withEndpoint, QnAMakerOptions options, BotTelemetryClient withTelemetryClient, Boolean withLogPersonalInformation)
Initializes a new instance of the QnAMaker class.
Parameters:
Method Details
callTrain
public CompletableFuture
Send feedback to the knowledge base.
Parameters:
Returns:
Throws:
fillQnAEvent
protected CompletableFuture
Fills the event properties and metrics for the QnaMessage event for telemetry. These properties are logged when the QnA GetAnswers method is called.
Parameters:
Returns:
Throws:
getAnswers
public CompletableFuture
Generates an answer from the knowledge base.
Parameters:
Returns:
getAnswers
public CompletableFuture
Generates an answer from the knowledge base.
Parameters:
Returns:
getAnswersRaw
public CompletableFuture
Generates an answer from the knowledge base.
Parameters:
Returns:
getLogPersonalInformation
public Boolean getLogPersonalInformation()
Gets a value indicating whether determines whether to log personal information that came from the user.
Returns:
getLowScoreVariation
public QueryResult[] getLowScoreVariation(QueryResult[] queryResult)
Filters the ambiguous question for active learning.
Parameters:
Returns:
getTelemetryClient
public BotTelemetryClient getTelemetryClient()
Gets the currently configured BotTelemetryClient.
Returns:
onQnaResults
protected CompletableFuture
Executed when a result is returned from QnA Maker.
Parameters:
Returns:
Throws: