QueryResult Class
- java.
lang. Object - com.
microsoft. bot. ai. qna. models. QueryResult
- com.
public class QueryResult
Represents an individual result from a knowledge base query.
Constructor Summary
| Constructor | Description | |
|---|---|---|
| QueryResult() | ||
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| java.lang.String |
getAnswer()
Gets the answer text. |
|
Qn |
getContext()
Gets context for multi-turn responses. |
| java.lang.Integer |
getId()
Gets the index of the answer in the knowledge base. |
| Metadata[] |
getMetadata()
Gets metadata that is associated with the answer. |
| java.lang.String[] |
getQuestions()
Gets the list of questions indexed in the QnA Service for the given answer. |
| java.lang.Float |
getScore()
Gets the answer's score, from 0.0 (least confidence) to 1.0 (greatest confidence). |
| java.lang.String |
getSource()
Gets the source from which the QnA was extracted. |
| void |
setAnswer(String withAnswer)
Sets the answer text. |
| void |
setContext(QnAResponseContext withContext)
Sets context for multi-turn responses. |
| void |
setId(Integer withId)
Sets the index of the answer in the knowledge base. |
| void |
setMetadata(Metadata[] withMetadata)
Sets metadata that is associated with the answer. |
| void |
setQuestions(String[] withQuestions)
Sets the list of questions indexed in the QnA Service for the given answer. |
| void |
setScore(Float withScore)
Sets the answer's score, from 0.0 (least confidence) to 1.0 (greatest confidence). |
| void |
setSource(String withSource)
Sets the source from which the QnA was extracted. |
Methods inherited from java.lang.Object
Constructor Details
QueryResult
public QueryResult()
Method Details
getAnswer
public String getAnswer()
Gets the answer text.
Returns:
getContext
public QnAResponseContext getContext()
Gets context for multi-turn responses.
Returns:
getId
public Integer getId()
Gets the index of the answer in the knowledge base. V3 uses 'qnaId', V4 uses 'id'.
Returns:
getMetadata
public Metadata[] getMetadata()
Gets metadata that is associated with the answer.
Returns:
getQuestions
public String[] getQuestions()
Gets the list of questions indexed in the QnA Service for the given answer.
Returns:
getScore
public Float getScore()
Gets the answer's score, from 0.0 (least confidence) to 1.0 (greatest confidence).
Returns:
getSource
public String getSource()
Gets the source from which the QnA was extracted.
Returns:
setAnswer
public void setAnswer(String withAnswer)
Sets the answer text.
Parameters:
setContext
public void setContext(QnAResponseContext withContext)
Sets context for multi-turn responses.
Parameters:
setId
public void setId(Integer withId)
Sets the index of the answer in the knowledge base. V3 uses 'qnaId', V4 uses 'id'.
Parameters:
setMetadata
public void setMetadata(Metadata[] withMetadata)
Sets metadata that is associated with the answer.
Parameters:
setQuestions
public void setQuestions(String[] withQuestions)
Sets the list of questions indexed in the QnA Service for the given answer.
Parameters:
setScore
public void setScore(Float withScore)
Sets the answer's score, from 0.0 (least confidence) to 1.0 (greatest confidence).
Parameters:
setSource
public void setSource(String withSource)
Sets the source from which the QnA was extracted.
Parameters: