Skip to content

Commit fe08ad4

Browse files
committed
[Cogsvcs] QnA - public issue 39055
1 parent cdd9002 commit fe08ad4

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

articles/cognitive-services/QnAMaker/Quickstarts/create-publish-kb-csharp-sdk.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: qna-maker
1010
ms.topic: quickstart
11-
ms.date: 08/30/2019
11+
ms.date: 09/21/2019
1212
ms.author: diberry
1313
---
1414

@@ -134,12 +134,16 @@ The final line of the following code returns the knowledge base ID from the resp
134134

135135
[!code-csharp[Create a knowledge base](~/samples-qnamaker-csharp/documentation-samples/quickstarts/Knowledgebase_Quickstart/Program.cs?name=CreateKB&highlight=29,30)]
136136

137+
Make sure the include the [`MonitorOperation`](#get-status-of-an-operation) function, referenced in the above code, in order to successfully create a knowledge base.
138+
137139
## Update a knowledge base
138140

139141
You can update a knowledge base by passing in the knowledge base ID and an [UpdatekbOperationDTO](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.knowledge.qnamaker.models.updatekboperationdto?view=azure-dotnet) containing [add](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.knowledge.qnamaker.models.updatekboperationdtoadd?view=azure-dotnet), [update](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.knowledge.qnamaker.models.updatekboperationdtoupdate?view=azure-dotnet), and [delete](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.knowledge.qnamaker.models.updatekboperationdtodelete?view=azure-dotnet) DTO objects to the [UpdateAsync](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.knowledge.qnamaker.knowledgebaseextensions.updateasync?view=azure-dotnet) method. Use the [MonitorOperation](#get-status-of-an-operation) method to determine if the update succeeded.
140142

141143
[!code-csharp[Update a knowledge base](~/samples-qnamaker-csharp/documentation-samples/quickstarts/Knowledgebase_Quickstart/Program.cs?name=UpdateKB&highlight=4,13)]
142144

145+
Make sure the include the [`MonitorOperation`](#get-status-of-an-operation) function, referenced in the above code, in order to successfully update a knowledge base.
146+
143147
## Download a knowledge base
144148

145149
Use the [DownloadAsync](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.knowledge.qnamaker.knowledgebaseextensions.downloadasync?view=azure-dotnet) method to download the database as a list of [QnADocumentsDTO](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.knowledge.qnamaker.models.qnadocumentsdto?view=azure-dotnet). This is _not_ equivalent to the QnA Maker portal's export from the **Settings** page because the result of this method is not a TSV file.
@@ -177,6 +181,8 @@ The _loop_ and _Task.Delay_ in the following code block are used to simulate ret
177181

178182
Run the application with the dotnet `run` command from your application directory.
179183

184+
All of the code snippets in this article are [available](https://github.com/Azure-Samples/cognitive-services-qnamaker-python/blob/master/documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.py) and can be run as a single file.
185+
180186
```console
181187
dotnet run
182188
```
@@ -197,5 +203,4 @@ If you want to clean up and remove a Cognitive Services subscription, you can de
197203
198204
* [What is the QnA Maker API?](../Overview/overview.md)
199205
* [Edit a knowledge base](../how-to/edit-knowledge-base.md)
200-
* [Get usage analytics](../how-to/get-analytics-knowledge-base.md)
201-
* The source code for this sample can be found on [GitHub](https://github.com/Azure-Samples/cognitive-services-qnamaker-csharp/blob/master/documentation-samples/quickstarts/Knowledgebase_Quickstart/Program.cs).
206+
* [Get usage analytics](../how-to/get-analytics-knowledge-base.md)

articles/cognitive-services/QnAMaker/Quickstarts/create-publish-kb-nodejs-sdk.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: qna-maker
1010
ms.topic: quickstart
11-
ms.date: 08/07/2019
11+
ms.date: 09/21/2019
1212
ms.author: diberry
1313
---
1414

@@ -117,13 +117,16 @@ Call the [create](https://docs.microsoft.com/javascript/api/@azure/cognitiveserv
117117

118118
[!code-javascript[Create a knowledge base](~/samples-qnamaker-nodejs/documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.js?name=createkb&highlight=15)]
119119

120+
Make sure the include the [`wait_for_operation`](#get-status-of-an-operation) function, referenced in the above code, in order to successfully create a knowledge base.
120121

121122
## Update a knowledge base
122123

123124
You can update a knowledge base by passing in the knowledge base ID and an [UpdateKbOperationDTO](https://docs.microsoft.com/javascript/api/@azure/cognitiveservices-qnamaker/updatekboperationdto?view=azure-node-latest) containing [add](https://docs.microsoft.com/javascript/api/@azure/cognitiveservices-qnamaker/updatekboperationdto?view=azure-node-latest#add), [update](https://docs.microsoft.com/javascript/api/@azure/cognitiveservices-qnamaker/updatekboperationdto?view=azure-node-latest#update), and [delete](https://docs.microsoft.com/javascript/api/@azure/cognitiveservices-qnamaker/updatekboperationdto?view=azure-node-latest#deleteproperty) DTO objects to the [update](https://docs.microsoft.com/javascript/api/@azure/cognitiveservices-qnamaker/knowledgebase?view=azure-node-latest#update-string--updatekboperationdto--msrest-requestoptionsbase-) method. Use the [Operation.getDetail](#get-status-of-an-operation) method to determine if the update succeeded.
124125

125126
[!code-javascript[Update a knowledge base](~/samples-qnamaker-nodejs/documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.js?name=updatekb&highlight=19)]
126127

128+
Make sure the include the [`wait_for_operation`](#get-status-of-an-operation) function, referenced in the above code, in order to successfully update a knowledge base.
129+
127130
## Publish a knowledge base
128131

129132
Publish the knowledge base using the [publish](https://docs.microsoft.com/javascript/api/@azure/cognitiveservices-qnamaker/knowledgebase?view=azure-node-latest#publish-string--msrest-requestoptionsbase-) method. This takes the current saved and trained model, referenced by the knowledge base ID, and publishes that at an endpoint.
@@ -148,6 +151,9 @@ The _setTimeout_ call in the following code block is used to simulate asynchrono
148151

149152
Run the application with `node index.js` command from your application directory.
150153

154+
155+
All of the code snippets in this article are [available](https://github.com/Azure-Samples/cognitive-services-qnamaker-nodejs/blob/master/documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.js) and can be run as a single file.
156+
151157
```console
152158
node index.js
153159
```
@@ -166,5 +172,4 @@ If you want to clean up and remove a Cognitive Services subscription, you can de
166172
167173
* [What is the QnA Maker API?](../Overview/overview.md)
168174
* [Edit a knowledge base](../how-to/edit-knowledge-base.md)
169-
* [Get usage analytics](../how-to/get-analytics-knowledge-base.md)
170-
* The source code for this sample can be found on [GitHub](https://github.com/Azure-Samples/cognitive-services-qnamaker-nodejs/blob/master/documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.js).
175+
* [Get usage analytics](../how-to/get-analytics-knowledge-base.md)

articles/cognitive-services/QnAMaker/Quickstarts/python-sdk.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: qna-maker
1010
ms.topic: quickstart
11-
ms.date: 08/09/2019
11+
ms.date: 09/21/2019
1212
ms.author: diberry
1313
---
1414

@@ -103,13 +103,16 @@ Call the [create](https://docs.microsoft.com/python/api/azure-cognitiveservices-
103103

104104
[!code-python[Create a knowledge base](~/samples-qnamaker-python/documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.py?name=createkb&highlight=15)]
105105

106+
Make sure the include the [`_monitor_operation`](#get-status-of-an-operation) function, referenced in the above code, in order to successfully create a knowledge base.
106107

107108
## Update a knowledge base
108109

109110
You can update a knowledge base by passing in the knowledge base ID and an [UpdateKbOperationDTO](https://docs.microsoft.com/python/api/azure-cognitiveservices-knowledge-qnamaker/azure.cognitiveservices.knowledge.qnamaker.models.updatekboperationdto?view=azure-python) containing [add](https://docs.microsoft.com/python/api/azure-cognitiveservices-knowledge-qnamaker/azure.cognitiveservices.knowledge.qnamaker.models.updatekboperationdtoadd?view=azure-python), [update](https://docs.microsoft.com/python/api/azure-cognitiveservices-knowledge-qnamaker/azure.cognitiveservices.knowledge.qnamaker.models.updatekboperationdtoupdate?view=azure-python), and [delete](https://docs.microsoft.com/python/api/azure-cognitiveservices-knowledge-qnamaker/azure.cognitiveservices.knowledge.qnamaker.models.updatekboperationdtodelete?view=azure-python) DTO objects to the [update](https://docs.microsoft.com/python/api/azure-cognitiveservices-knowledge-qnamaker/azure.cognitiveservices.knowledge.qnamaker.operations.knowledgebaseoperations?view=azure-python#update-kb-id--update-kb--custom-headers-none--raw-false----operation-config-) method. Use the [Operation.getDetail](#get-status-of-an-operation) method to determine if the update succeeded.
110111

111112
[!code-python[Update a knowledge base](~/samples-qnamaker-python/documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.py?name=updatekb&highlight=2)]
112113

114+
Make sure the include the [`_monitor_operation`](#get-status-of-an-operation) function, referenced in the above code, in order to successfully update a knowledge base.
115+
113116
## Publish a knowledge base
114117

115118
Publish the knowledge base using the [publish](https://docs.microsoft.com/python/api/azure-cognitiveservices-knowledge-qnamaker/azure.cognitiveservices.knowledge.qnamaker.operations.knowledgebaseoperations?view=azure-python#publish-kb-id--custom-headers-none--raw-false----operation-config-) method. This takes the current saved and trained model, referenced by the knowledge base ID, and publishes that at an endpoint.
@@ -140,6 +143,8 @@ The _setTimeout_ call in the following code block is used to simulate asynchrono
140143

141144
Run the application with `python knowledgebase_quickstart.py` command from your application directory.
142145

146+
All of the code snippets in this article are [available](https://github.com/Azure-Samples/cognitive-services-qnamaker-python/blob/master/documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.py) and can be run as a single file.
147+
143148
```console
144149
python knowledgebase_quickstart.py
145150
```
@@ -158,5 +163,4 @@ If you want to clean up and remove a Cognitive Services subscription, you can de
158163
159164
* [What is the QnA Maker API?](../Overview/overview.md)
160165
* [Edit a knowledge base](../how-to/edit-knowledge-base.md)
161-
* [Get usage analytics](../how-to/get-analytics-knowledge-base.md)
162-
* The source code for this sample can be found on [GitHub](https://github.com/Azure-Samples/cognitive-services-qnamaker-python/blob/master/documentation-samples/quickstarts/knowledgebase_quickstart/knowledgebase_quickstart.py).
166+
* [Get usage analytics](../how-to/get-analytics-knowledge-base.md)

0 commit comments

Comments
 (0)