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
@@ -18,15 +20,18 @@ Use the QnA Maker client library for .NET to:
18
20
## Prerequisites
19
21
20
22
* Azure subscription - [Create one for free](https://azure.microsoft.com/free/)
21
-
* The current version of [.NET Core](https://dotnet.microsoft.com/download/dotnet-core).
23
+
* The [Visual Studio IDE](https://visualstudio.microsoft.com/vs/) or current version of [.NET Core](https://dotnet.microsoft.com/download/dotnet-core).
24
+
* Once you have your Azure subscription, create a [QnA Maker resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesQnAMaker) in the Azure portal to get your authoring key and endpoint. After it deploys, select **Go to resource**.
25
+
* You will need the key and endpoint from the resource you create to connect your application to the QnA Maker API. You'll paste your key and endpoint into the code below later in the quickstart.
26
+
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
22
27
23
28
## Setting up
24
29
25
30
### Create a QnA Maker Azure resource
26
31
27
32
Azure Cognitive Services are represented by Azure resources that you subscribe to. Create a resource for QnA Maker using the [Azure portal](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) or [Azure CLI](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli) on your local machine.
28
33
29
-
After getting a key and endpoint for your resource, [create environment variables](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account#configure-an-environment-variable-for-authentication) for the key, named `QNAMAKER_SUBSCRIPTION_KEY`. The resource name is used as part of the endpoint URL.
34
+
After getting a key and endpoint for your resource, [create an environment variable](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account#configure-an-environment-variable-for-authentication) for the key, named `QNAMAKER_SUBSCRIPTION_KEY`. The resource name is used as custom subdomain of the endpoint URL.
30
35
31
36
### Create a new C# application
32
37
@@ -115,7 +120,7 @@ In the **main** method, create a variable for your resource's authentication pul
115
120
116
121
Create a [QnAMakerRuntimeClient](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.knowledge.qnamaker.qnamakerruntimeclient?view=azure-dotnet) to query the knowledge base to generate an answer or train from active learning.
117
122
118
-
[!code-csharp[Authenticate the runtime](~/samples-qnamaker-csharp/documentation-samples/quickstarts/Knowledgebase_Quickstart/Program.cs?name=EndpointKey)]
123
+
[!code-csharp[Authenticate the runtime](~/samples-qnamaker-csharp/documentation-samples/quickstarts/Knowledgebase_Quickstart/Program.cs?name=EndpointKey&highlight=3)]
119
124
120
125
## Create a knowledge base
121
126
@@ -129,7 +134,7 @@ Call the [CreateAsync](https://docs.microsoft.com/dotnet/api/microsoft.azure.cog
129
134
130
135
The final line of the following code returns the knowledge base ID from the response from MonitorOoperation.
131
136
132
-
[!code-csharp[Create a knowledge base](~/samples-qnamaker-csharp/documentation-samples/quickstarts/Knowledgebase_Quickstart/Program.cs?name=CreateKB&highlight=29,30)]
137
+
[!code-csharp[Create a knowledge base](~/samples-qnamaker-csharp/documentation-samples/quickstarts/Knowledgebase_Quickstart/Program.cs?name=CreateKB&highlight=30)]
133
138
134
139
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.
Copy file name to clipboardExpand all lines: articles/cognitive-services/QnAMaker/includes/quickstart-sdk-nodejs.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,9 @@ Use the QnA Maker client library for Node.js to:
21
21
22
22
* Azure subscription - [Create one for free](https://azure.microsoft.com/free/)
23
23
* The current version of [Node.js](https://nodejs.org).
24
+
* Once you have your Azure subscription, create a [QnA Maker resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesQnAMaker) in the Azure portal to get your authoring key and endpoint. After it deploys, select **Go to resource**.
25
+
* You will need the key and endpoint from the resource you create to connect your application to the QnA Maker API. You'll paste your key and endpoint into the code below later in the quickstart.
26
+
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
24
27
25
28
## Setting up
26
29
@@ -126,7 +129,7 @@ Make sure the include the [`wait_for_operation`](#get-status-of-an-operation) fu
126
129
127
130
## Publish a knowledge base
128
131
129
-
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. Check the HTTP response code to validate publish succeeded.
132
+
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. Check the HTTP response code to validate that the publish succeeded.
130
133
131
134
[!code-javascript[Publish a knowledge base](~/cognitive-services-quickstart-code/javascript/QnAMaker/sdk/qnamaker_quickstart.js?name=publishKnowledgeBase&highlight=3)]
@@ -18,6 +21,9 @@ Use the QnA Maker client library for python to:
18
21
19
22
* Azure subscription - [Create one for free](https://azure.microsoft.com/free/)
20
23
*[Python 3.x](https://www.python.org/)
24
+
* Once you have your Azure subscription, create a [QnA Maker resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesQnAMaker) in the Azure portal to get your authoring key and endpoint. After it deploys, select **Go to resource**.
25
+
* You will need the key and endpoint from the resource you create to connect your application to the QnA Maker API. You'll paste your key and endpoint into the code below later in the quickstart.
26
+
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
0 commit comments