Skip to content

Commit e751444

Browse files
authored
Merge pull request #89583 from diberry/0924-qna-custom-domain
0924 qna custom domain
2 parents ae5679d + 87ac3c6 commit e751444

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.custom: seodec18
99
ms.service: cognitive-services
1010
ms.subservice: qna-maker
1111
ms.topic: quickstart
12-
ms.date: 07/16/2019
12+
ms.date: 09/24/2019
1313
ms.author: diberry
1414
#Customer intent: As an API or REST developer new to the QnA Maker service, I want to programmatically create a knowledge base using C#.
1515
---
@@ -45,24 +45,26 @@ At the top of Program.cs, replace the single using statement with the following
4545

4646
At the top of the Program class, add the following constants to access QnA Maker:
4747

48-
[!code-csharp[Add the required constants](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=17-24 "Add the required constants")]
48+
[!code-csharp[Add the required constants](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=17-26 "Add the required constants")]
4949

5050
## Add the KB definition
5151

5252
After the constants, add the following KB definition:
5353

54-
[!code-csharp[Add the required constants](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=32-57 "Add the required constants")]
54+
[!code-csharp[Add the required constants](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=28-58 "Add the knowledge base definition")]
5555

5656
## Add supporting functions and structures
5757
Add the following code block inside the Program class:
5858

59-
[!code-csharp[Add supporting functions and structures](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=62-82 "Add supporting functions and structures")]
59+
[!code-csharp[Add supporting functions and structures](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=60-99 "Add supporting functions and structures")]
6060

6161
## Add a POST request to create KB
6262

6363
The following code makes an HTTPS request to the QnA Maker API to create a KB and receives the response:
6464

65-
[!code-csharp[Add a POST request to create KB](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=91-105 "Add a POST request to create KB")]
65+
[!code-csharp[Add PostCreateKB to request via POST](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=145-165 "Add PostCreateKB to request via POST")]
66+
67+
[!code-csharp[Add a POST request to create KB](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=101-122 "Add a POST request to create KB")]
6668

6769
This API call returns a JSON response that includes the operation ID. Use the operation ID to determine if the KB is successfully created.
6870

@@ -80,7 +82,9 @@ This API call returns a JSON response that includes the operation ID. Use the op
8082

8183
Check the status of the operation.
8284

83-
[!code-csharp[Add GET request to determine creation status](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=159-170 "Add GET request to determine creation status")]
85+
[!code-csharp[Add GetStatus to request via GET](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=167-187 "Add GetStatus to request via GET")]
86+
87+
[!code-csharp[Add GET request to determine creation status](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=124-143 "Add GET request to determine creation status")]
8488

8589
This API call returns a JSON response that includes the operation status:
8690

@@ -111,13 +115,13 @@ Repeat the call until success or failure:
111115

112116
The following method creates the KB and repeats checks on the status. The _create_ **Operation ID** is returned in the POST response header field **Location**, then used as part of the route in the GET request. Because the KB creation may take some time, you need to repeat calls to check the status until the status is either successful or fails. When the operation succeeds, the KB ID is returned in **resourceLocation**.
113117

114-
[!code-csharp[Add CreateKB method](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=176-237 "Add CreateKB method")]
118+
[!code-csharp[Add CreateKB method](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=189-254 "Add CreateKB method")]
115119

116120
## Add the CreateKB method to Main
117121

118122
Change the Main method to call the CreateKB method:
119123

120-
[!code-csharp[Add CreateKB method](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=239-248 "Add CreateKB method")]
124+
[!code-csharp[Add CreateKB method](~/samples-qnamaker-csharp/documentation-samples/quickstarts/create-knowledge-base/QnaQuickstartCreateKnowledgebase/Program.cs?range=256-265 "Add CreateKB method")]
121125

122126
## Build and run the program
123127

articles/cognitive-services/QnAMaker/Quickstarts/get-answer-from-knowledge-base-csharp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: qna-maker
1111
ms.topic: quickstart
12-
ms.date: 09/04/2019
12+
ms.date: 09/24/2019
1313
ms.author: diberry
1414
#Customer intent: As an API or REST developer new to the QnA Maker service, I want to programmatically get an answer a knowledge base using C#.
1515
---
@@ -46,13 +46,13 @@ At the top of the Program.cs file, replace the single using statement with the f
4646

4747
At the top of the `Program` class, inside the `Main`, add the required constants to access QnA Maker. These values are on the **Publish** page after you publish the knowledge base.
4848

49-
[!code-csharp[Add the required constants](~/samples-qnamaker-csharp/documentation-samples/quickstarts/get-answer/QnAMakerAnswerQuestion/Program.cs?range=14-30 "Add the required constants")]
49+
[!code-csharp[Add the required constants](~/samples-qnamaker-csharp/documentation-samples/quickstarts/get-answer/QnAMakerAnswerQuestion/Program.cs?range=9-41 "Add the required constants")]
5050

5151
## Add a POST request to send question and get answer
5252

5353
The following code makes an HTTPS request to the QnA Maker API to send the question to the knowledge base and receives the response:
5454

55-
[!code-csharp[Add a POST request to send question to knowledge base](~/samples-qnamaker-csharp/documentation-samples/quickstarts/get-answer/QnAMakerAnswerQuestion/Program.cs?range=32-57 "Add a POST request to send question to knowledge base")]
55+
[!code-csharp[Add a POST request to send question to knowledge base](~/samples-qnamaker-csharp/documentation-samples/quickstarts/get-answer/QnAMakerAnswerQuestion/Program.cs?range=43-76 "Add a POST request to send question to knowledge base")]
5656

5757
The `Authorization` header's value includes the string `EndpointKey`.
5858

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.custom: seodec18
99
ms.service: cognitive-services
1010
ms.subservice: qna-maker
1111
ms.topic: quickstart
12-
ms.date: 09/03/2019
12+
ms.date: 09/24/2019
1313
ms.author: diberry
1414
#Customer intent: As an API or REST developer new to the QnA Maker service, I want to programmatically publish a knowledge base using C#.
1515
---
@@ -47,15 +47,15 @@ At the top of Program.cs, replace the single using statement with the following
4747

4848
## Add required constants
4949

50-
In the **Main** method, add the required constants to access QnA Maker. Replace the values with your own.
50+
In the **Program** class, add the required constants to access QnA Maker.
5151

52-
[!code-csharp[Add the required constants](~/samples-qnamaker-csharp/documentation-samples/quickstarts/publish-knowledge-base/QnAMakerPublishQuickstart/Program.cs?range=11-14 "Add the required constants")]
52+
[!code-csharp[Add the required constants](~/samples-qnamaker-csharp/documentation-samples/quickstarts/publish-knowledge-base/QnAMakerPublishQuickstart/Program.cs?range=8-34 "Add the required constants")]
5353

54-
## Add POST request to publish knowledge base
54+
## Add the Main method to publish the knowledge base
5555

5656
After the required constants, add the following code, which makes an HTTPS request to the QnA Maker API to publish a knowledge base and receives the response:
5757

58-
[!code-csharp[Add HTTP Post request and response](~/samples-qnamaker-csharp/documentation-samples/quickstarts/publish-knowledge-base/QnAMakerPublishQuickstart/Program.cs?range=16-29&dedent=8 "Add HTTP Post request and response")]
58+
[!code-csharp[Add HTTP Post request and response](~/samples-qnamaker-csharp/documentation-samples/quickstarts/publish-knowledge-base/QnAMakerPublishQuickstart/Program.cs?range=36-56 "Add HTTP Post request and response")]
5959

6060
The API call returns a 204 status for a successful publish without any content in the body of the response.
6161

0 commit comments

Comments
 (0)