Skip to content

Commit ccc096f

Browse files
committed
fixes to code snippets
1 parent 17b421e commit ccc096f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

articles/cognitive-services/LUIS/includes/sdk-nodejs-prediction.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ From the project directory, open the `luis_prediction.js` file in your preferred
7676

7777
1. Create a variable for the app ID as an environment variable named `LUIS_APP_ID`. Set the environment variable to the public IoT app, **`df67dcdb-c37d-46af-88e1-8b97951ca1c2`** . Create a variable to set the `production` published slot.
7878

79-
[!code-javascript [LUIS app variables](~/cognitive-services-quickstart-code/javascript/LUIS/luis_prediction.js?name=OtherVariables>)]
79+
[!code-javascript [LUIS app variables](~/cognitive-services-quickstart-code/javascript/LUIS/luis_prediction.js?name=OtherVariables)]
8080

8181

8282
1. Create an msRest.ApiKeyCredentials object with your key, and use it with your endpoint to create an [LUIS.LUISRuntimeClient](https://docs.microsoft.com/javascript/api/@azure/cognitiveservices-luis-runtime/luisruntimeclient?view=azure-node-latest) object.
8383

84-
[!code-javascript [LUIS Runtime client is required to access predictions for LUIS apps](~/cognitive-services-quickstart-code/javascript/LUIS/luis_prediction.js?name=AuthoringCreateClient>)]
84+
[!code-javascript [LUIS Runtime client is required to access predictions for LUIS apps](~/cognitive-services-quickstart-code/javascript/LUIS/luis_prediction.js?name=AuthoringCreateClient)]
8585

8686
## Get prediction from runtime
8787

@@ -91,13 +91,13 @@ The user utterance is part of the [predictionRequest](https://docs.microsoft.com
9191

9292
The **[luisRuntimeClient.prediction.getSlotPrediction](https://docs.microsoft.com/javascript/api/@azure/cognitiveservices-luis-runtime/predictionoperations?view=azure-node-latest#getslotprediction-string--string--predictionrequest--models-predictiongetslotpredictionoptionalparams-)** method needs several parameters such as the app ID, the slot name, and the prediction request object to fulfill the request. The other options such as verbose, show all intents, and log are optional.
9393

94-
[!code-javascript [LUIS prediction request and response in Node.js NPM SDK](~/cognitive-services-quickstart-code/javascript/LUIS/luis_prediction.js?name=predict>)]
94+
[!code-javascript [LUIS prediction request and response in Node.js NPM SDK](~/cognitive-services-quickstart-code/javascript/LUIS/luis_prediction.js?name=predict)]
9595

9696
## Main code for the prediction
9797

9898
Use the following main method to tie the variables and methods together to get the prediction.
9999

100-
[!code-javascript [Main method and main call](~/cognitive-services-quickstart-code/javascript/LUIS/luis_prediction.js?name=Main>)]
100+
[!code-javascript [Main method and main call](~/cognitive-services-quickstart-code/javascript/LUIS/luis_prediction.js?name=Main)]
101101

102102
## Run the application
103103

articles/cognitive-services/LUIS/includes/sdk-python-prediction.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ From the project directory, open the `prediction_quickstart.py` file in your pre
8383

8484
1. Create a credentials object with your key, and use it with your endpoint to create an [LUISRuntimeClientConfiguration]https://docs.microsoft.com//python/api/azure-cognitiveservices-language-luis/azure.cognitiveservices.language.luis.runtime.luisruntimeclientconfiguration?view=azure-python() object.
8585

86-
[!code-python[Dependency statements](~/cognitive-services-quickstart-code/python/LUIS/prediction_quickstart.py?name=Client)]
86+
[!code-python[Dependency statements](~/cognitive-services-quickstart-code/python/LUIS/prediction_quickstart.py?name=Client)]
8787

8888
## Get prediction from runtime
8989

@@ -99,13 +99,14 @@ The **[get_slot_prediction](https://docs.microsoft.com//python/api/azure-cogniti
9999

100100
Use the following main method to tie the variables and methods together to get the prediction.
101101

102-
[!code-python[Dependency statements](~/cognitive-services-quickstart-code/python/LUIS/prediction_quickstart.py?name=main)]
103-
102+
```python
103+
predict(luisAppID, luisSlotName)
104+
```
104105
## Run the application
105106

106107
Run the application with the `python prediction_quickstart.py` command from your application directory.
107108

108-
```python
109+
```console
109110
python prediction_quickstart.py
110111
```
111112

0 commit comments

Comments
 (0)