You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cognitive-services/QnAMaker/How-To/metadata-generateanswer-usage.md
+13-38Lines changed: 13 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ manager: nitinme
8
8
ms.service: cognitive-services
9
9
ms.subservice: qna-maker
10
10
ms.topic: article
11
-
ms.date: 06/17/2019
11
+
ms.date: 06/27/2019
12
12
ms.author: diberry
13
13
---
14
14
@@ -32,13 +32,13 @@ Each QnA entity has a unique and persistent ID. You can use the ID to make updat
32
32
33
33
## Get answer predictions with the GenerateAnswer API
34
34
35
-
You use the GenerateAnswer API in your bot or application to query your knowledge base with a user question, to get the best match from the question and answer sets.
35
+
You use the [GenerateAnswer API](https://docs.microsoft.com/rest/api/cognitiveservices/qnamakerruntime/runtime/generateanswer) in your bot or application to query your knowledge base with a user question, to get the best match from the question and answer sets.
36
36
37
37
<aname="generateanswer-endpoint"></a>
38
38
39
39
## Publish to get GenerateAnswer endpoint
40
40
41
-
After you publish your knowledge base, either from the [QnA Maker portal](https://www.qnamaker.ai), or by using the [API](https://go.microsoft.com/fwlink/?linkid=2092179), you can get the details of your GenerateAnswer endpoint.
41
+
After you publish your knowledge base, either from the [QnA Maker portal](https://www.qnamaker.ai), or by using the [API](https://docs.microsoft.com/rest/api/cognitiveservices/qnamaker/knowledgebase/publish), you can get the details of your GenerateAnswer endpoint.
42
42
43
43
To get your endpoint details:
44
44
1. Sign in to [https://www.qnamaker.ai](https://www.qnamaker.ai).
@@ -54,34 +54,21 @@ You can also get your endpoint details from the **Settings** tab of your knowled
54
54
55
55
## GenerateAnswer request configuration
56
56
57
-
You call GenerateAnswer with an HTTP POST request. For sample code that shows how to call GenerateAnswer, see the [quickstarts](../quickstarts/csharp.md).
57
+
You call GenerateAnswer with an HTTP POST request. For sample code that shows how to call GenerateAnswer, see the [quickstarts](../quickstarts/csharp.md).
|URL route parameter|Knowledge base ID|string|The GUID for your knowledge base.|
68
-
|URL route parameter|QnAMaker endpoint host|string|The hostname of the endpoint deployed in your Azure subscription. This is available on the **Settings** page after you publish the knowledge base. |
69
-
|Header|Content-Type|string|The media type of the body sent to the API. Default value is: ``|
|Post Body|JSON object|JSON|The question with settings.|
72
-
73
-
74
-
The JSON body has several settings:
75
-
76
-
|JSON body property|Required|Type|Purpose|
77
-
|--|--|--|--|
78
-
|`question`|required|string|A user question to be sent to your knowledge base.|
79
-
|`top`|optional|integer|The number of ranked results to include in the output. The default value is 1.|
80
-
|`userId`|optional|string|A unique ID to identify the user. This ID will be recorded in the chat logs.|
81
-
|`scoreThreshold`|optional|integer|Only answers with confidence score above this threshold will be returned. The default value is 0.|
82
-
|`isTest`|optional|Boolean|If set to true, returns results from `testkb` Search index instead of published index.|
83
-
|`strictFilters`|optional|string|If specified, tells QnA Maker to return only answers that have the specified metadata. Use `none` to indicate response should have no metadata filters. |
84
-
|`RankerType`|optional|string|If specified as `QuestionOnly`, tells QnA Maker to search questions only. If not specified, QnA Maker searches questions and answers.
71
+
Remember to set the HTTP header property of `Authorization` with a value of the string `EndpointKey ` with a trailing space then the endpoint key found on the **Settings** page.
85
72
86
73
An example JSON body looks like:
87
74
@@ -104,19 +91,7 @@ An example JSON body looks like:
104
91
105
92
## GenerateAnswer response properties
106
93
107
-
A successful response returns a status of 200 and a JSON response.
108
-
109
-
|Answers property (sorted by score)|Purpose|
110
-
|--|--|
111
-
|score|A ranking score between 0 and 100.|
112
-
|Id|A unique ID assigned to the answer.|
113
-
|questions|The questions provided by the user.|
114
-
|answer|The answer to the question.|
115
-
|source|The name of the source from which the answer was extracted or saved in the knowledge base.|
116
-
|metadata|The metadata associated with the answer.|
117
-
|metadata.name|Metadata name. (string, max Length: 100, required)|
118
-
|metadata.value|Metadata value. (string, max Length: 100, required)|
119
-
94
+
The [response](https://docs.microsoft.com/rest/api/cognitiveservices/qnamakerruntime/runtime/generateanswer#successful_query) is a JSON object including all the information you need to display the answer and the next turn in the conversation, if available.
0 commit comments