[Azure LUIS Connector] Azure LUIS Connector - Documentation

Forge Component
(0)
Published on 15 Apr (7 days ago) by Félix Barros
0 votes
Published on 15 Apr (7 days ago) by Félix Barros

How to use Azure LUIS Connector in your OutSystems application


The Azure LUIS Connector provides Server Actions for two different APIs:

  • LUIS Endpoint API - Obtains predictions regarding the intent of a given text

  • LUIS Programmatic API - Manages the LUIS applications and models programmatically


Prerequisites

  1. Create a LUIS account and a LUIS application

  2. Create a Cognitive Service or Language Understanding resource in Azure Portal.

  3. Associate the above resource to your LUIS application.

  4. Train and publish your LUIS application.


LUIS Endpoint API

To use the LUIS Endpoint API, do the following:

  1. After installing the connector in your environment, go to your LUIS account and copy one of the Endpoint Keys from the resource you have associated with the application. 

Don’t use the key from the Starter_Key resource. The key from the Starter_Key resource is the same as the Authoring Key.

  1. Go to Service Center and in the Applications tab under Factory, select Azure LUIS Connector.

  1. Select the module AzureLUISConnector and go to the Site Properties tab.

  1. In the Site Properties tab, click EndpointKey. Edit the EndpointKey value and paste the key you’ve copied from the LUIS portal.

  1. In the LUIS Portal, copy the Endpoint from the associated resource and obtain the Base URL from it. 

For example, for an Endpoint like https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/XXXXXXXX?verbose=true&timezoneOffset=-360&subscription-key=XXXXXXXX&q=, the Base URL is https://westus.api.cognitive.microsoft.com/luis/v2.0/apps.

  1. Put the Base URL in the LUISEndpointBaseURL Site Property. 


After configuring the connector, test the Endpoint API as follows:

  1. Use the Server Action GetPredictions_Wrapper in a logic flow.

  2. From the Application Information page under the Manage tab of the LUIS Portal, copy the Application ID and add it in the ApplicationId input parameter of GetPredictions_Wrapper.

  1. Add any text in the QueryToPredict input parameter.

  2. Publish and test to confirm if the Server Action returns a prediction object.

You can now use all the Server Actions found in the folder LUISEndpointAPI. The descriptions of each input and output parameter provide more information about their usage.


You can find more information in the official Azure API documentation on LUIS Endpoint API.


LUIS Programmatic API

To use the LUIS Programmatic API, do the following:

  1. After installing the connector in your environment, go to your LUIS account and copy the Authoring Key.

  1. Go to Service Center and in the Applications tab under Factory, select Azure LUIS Connector.

  1. Select the module AzureLUISConnector and go to the Site Properties tab.

  1. In the Site Properties tab, click AuthoringKey. Edit the AuthoringKey value and paste the key you’ve copied from the LUIS portal.


After configuring the connector, test the Programmatic API as follows:

  1. Use the Server Action GetApplicationDomainsList in a logic flow.

  2. Enter your AuthoringRegionId. The value of the AuthoringRegionId must match the Authoring Region of your LUIS account.

  3. Publish and test to confirm that the Server Action returns a list of domains available on LUIS.

You can now use all the Server Actions found in the folder LUISProgrammaticAPI. The descriptions of each input and output parameter provide more information about their usage.


Note: When using the connector in your applications, the input parameter AuthoringRegionId of the Server Actions in this API must match the Authoring Region of your LUIS account. You can find this region in your LUIS account settings. Choose one of the 3 options provided by the static entity AuthoringRegion (also available in the connector).



You can find more information in the official Azure API documentation on LUIS Programmatic API.