Description | : Answers the specified question using your knowledge base. |
Reference | : Link ¶ |
⚶ Changes
{ "#id": "QuestionAnswering_GetAnswers", "$parameters": [ { "#name": "api-version", "Description": { "new": "The API version to use for this operation.", "old": "Client API version." } }, { "knowledgeBaseQueryOptions": { "$properties": [ { "#name": "qnaId", "Description": { "new": "Exact QnA ID to fetch from the knowledge base, this field takes priority over\nquestion.", "old": "Exact QnA ID to fetch from the knowledge base, this field takes priority over question." } }, { "#name": "rankerType", "Enum": { "new": [ [ "QuestionOnly", "Question only ranker." ], [ "Default", "Default ranker." ] ], "old": [ [ "Default", "Default ranker." ], [ "QuestionOnly", "Question only ranker." ] ] } }, { "filters": [ { "metadataFilter": [ { "#name": "logicalOperation", "Enum": { "new": [ [ "AND", "'AND' for using corresponding logical operation." ], [ "OR", "Set 'OR' for using corresponding logical operation." ] ], "old": [ [ "AND", "" ], [ "OR", "" ] ] } } ] }, { "#name": "sourceFilter", "Description": { "new": "Find QnAs that are associated with any of the given list of sources in\nknowledge base.", "old": "Find QnAs that are associated with any of the given list of sources in knowledge base." }, "Type": { "new": "array", "old": "object" } }, { "#name": "logicalOperation", "Enum": { "new": [ [ "AND", "'AND' for using corresponding logical operation." ], [ "OR", "Set 'OR' for using corresponding logical operation." ] ], "old": [ [ "AND", "" ], [ "OR", "" ] ] } } ] }, { "answerSpanRequest": [ { "#name": "confidenceScoreThreshold", "Description": { "new": "Minimum threshold score required to include an answer span, value ranges from 0\nto 1.", "old": "Minimum threshold score required to include an answer span, value ranges from 0 to 1." } } ] } ] } } ], "$responses": { "200": { "$properties": { "answers": { "$properties": [ { "#name": "metadata", "Description": { "new": "Metadata associated with the answer, useful to categorize or filter question\nanswers.", "old": "Metadata associated with the answer, useful to categorize or filter question answers." } }, { "dialog": [ { "#name": "isContextOnly", "Description": { "new": "To mark if a prompt is relevant only with a previous question or not. If true,\ndo not include this QnA as search result for queries without context;\notherwise, if false, ignores context and includes this QnA in search result.", "old": "To mark if a prompt is relevant only with a previous question or not. If true, do not include this QnA as search result for queries without context; otherwise, if false, ignores context and includes this QnA in search result." } } ] } ] } } }, "default": { "$properties": { "error": [ { "#name": "code", "Enum": { "new": [ [ "InvalidRequest", "Invalid request error" ], [ "InvalidArgument", "Invalid argument error" ], [ "Unauthorized", "Unauthorized access error" ], [ "Forbidden", "Forbidden access error" ], [ "NotFound", "Not found error" ], [ "ProjectNotFound", "Project not found error" ], [ "OperationNotFound", "Operation not found error" ], [ "AzureCognitiveSearchNotFound", "Azure Cognitive Search not found error" ], [ "AzureCognitiveSearchIndexNotFound", "Azure Cognitive Search index not found error" ], [ "TooManyRequests", "Too many requests error" ], [ "AzureCognitiveSearchThrottling", "Azure Cognitive Search throttling error" ], [ "AzureCognitiveSearchIndexLimitReached", "Azure Cognitive Search index limit reached error" ], [ "InternalServerError", "Internal server error" ], [ "ServiceUnavailable", "Service unavailable error" ], [ "Timeout", "Timeout error" ], [ "QuotaExceeded", "Quota exceeded error" ], [ "Conflict", "Conflict error" ], [ "Warning", "Warning error" ] ], "old": [ [ "InvalidRequest", "" ], [ "InvalidArgument", "" ], [ "Unauthorized", "" ], [ "Forbidden", "" ], [ "NotFound", "" ], [ "ProjectNotFound", "" ], [ "OperationNotFound", "" ], [ "AzureCognitiveSearchNotFound", "" ], [ "AzureCognitiveSearchIndexNotFound", "" ], [ "TooManyRequests", "" ], [ "AzureCognitiveSearchThrottling", "" ], [ "AzureCognitiveSearchIndexLimitReached", "" ], [ "InternalServerError", "" ], [ "ServiceUnavailable", "" ], [ "Timeout", "" ], [ "QuotaExceeded", "" ], [ "Conflict", "" ], [ "Warning", "" ] ] } }, { "innererror": [ { "#name": "code", "Enum": { "new": [ [ "InvalidRequest", "Invalid request error" ], [ "InvalidParameterValue", "Invalid parameter value error" ], [ "KnowledgeBaseNotFound", "Knowledge base not found error" ], [ "AzureCognitiveSearchNotFound", "Azure Cognitive Search not found error" ], [ "AzureCognitiveSearchThrottling", "Azure Cognitive Search throttling error" ], [ "ExtractionFailure", "Extraction failure error" ], [ "InvalidRequestBodyFormat", "Invalid request body format error" ], [ "EmptyRequest", "Empty request error" ], [ "MissingInputDocuments", "Missing input documents error" ], [ "InvalidDocument", "Invalid document error" ], [ "ModelVersionIncorrect", "Model version incorrect error" ], [ "InvalidDocumentBatch", "Invalid document batch error" ], [ "UnsupportedLanguageCode", "Unsupported language code error" ], [ "InvalidCountryHint", "Invalid country hint error" ] ], "old": [ [ "InvalidRequest", "" ], [ "InvalidParameterValue", "" ], [ "KnowledgeBaseNotFound", "" ], [ "AzureCognitiveSearchNotFound", "" ], [ "AzureCognitiveSearchThrottling", "" ], [ "ExtractionFailure", "" ], [ "InvalidRequestBodyFormat", "" ], [ "EmptyRequest", "" ], [ "MissingInputDocuments", "" ], [ "InvalidDocument", "" ], [ "ModelVersionIncorrect", "" ], [ "InvalidDocumentBatch", "" ], [ "UnsupportedLanguageCode", "" ], [ "InvalidCountryHint", "" ] ] } } ] } ] } } } }
⚼ Request
POST:
/:query-knowledgebases
{
api-version:
string
,
projectName:
string
,
deploymentName:
string
,
knowledgeBaseQueryOptions:
}
{
,
qnaId:
integer
,
question:
string
,
top:
integer
,
userId:
string
,
confidenceScoreThreshold:
number
,
context:
{
,
previousQnaId:
integer
,
previousUserQuery:
string
,
}
rankerType:
enum
,
filters:
{
,
metadataFilter:
{
,
metadata:
[
]
,
{
,
key:
string
,
value:
string
,
}
logicalOperation:
enum
,
}
sourceFilter:
[
,
string
,
]
logicalOperation:
enum
,
}
answerSpanRequest:
{
,
enable:
boolean
,
confidenceScoreThreshold:
number
,
topAnswersWithSpan:
integer
,
}
includeUnstructuredSources:
boolean
,
}
⚐ Response (200)
{
answers:
}
[
]
,
{
,
questions:
[
,
string
,
]
answer:
string
,
confidenceScore:
number
,
id:
integer
,
source:
string
,
metadata:
object
,
dialog:
{
,
isContextOnly:
boolean
,
prompts:
}
[
]
,
{
,
displayOrder:
integer
,
qnaId:
integer
,
displayText:
string
,
}
answerSpan:
}
{
,
text:
string
,
confidenceScore:
number
,
offset:
integer
,
length:
integer
,
}
⚐ Response (default)
{
$headers:
{
,
x-ms-error-code:
string
,
}
$schema:
}
{
,
error:
}
{
,
code:
enum
,
message:
string
,
target:
string
,
details:
[
,
string
,
]
innererror:
}
{
,
code:
enum
,
message:
string
,
details:
object
,
target:
string
,
innererror:
string
,
}