How to add a Prediction Resource to LUIS app programmatically - azure-language-understanding

I am using C# SDK to create the LUIS apps with required Intents, Utterances and Entities, and then training and Publishing the apps using an Authoring key created in Azure portal. After this, I use the REST Prediction endpoint for Intent matching, and till now I used the free Starter Prediction Key. After a month since the Starter key gets expired, I created a Cognitive service in Azure to be used as the Prediction resource. Now, how to add this new Prediction resource(Cognitive service) to my LUIS apps via SDK or REST? I am able to do so from LUIS Portal though, but don't want manual intervention.

Once you create the prediction endpoint resource, the resource should be only used for endpoint prediction queries and not for authoring changes to the app. If you want to add the prediction resource to your app by not going through the portal and automate the assignment of the resource to a LUIS app for purposes like CI/CD pipeline, then you can follow the steps below:
Get an Azure Resource Manager token from this website. This token does expire so use it immediately. The request returns an Azure Resource Manager token.
Use the token to request the LUIS runtime resources across subscriptions, from the Get LUIS azure accounts API, which your user account has access to.
This POST API requires the following settings:
This API returns an array of JSON objects of your LUIS subscriptions including subscription ID, resource group, and resource name, returned as account name. Find the one item in the array that is the LUIS resource to assign to the LUIS app.
Assign the token to the LUIS resource with the Assign a LUIS azure accounts to an application API.
This POST API requires the following settings:
When this API is successful, it returns a 201 - created status.
Hope this helps.

Thanks, accepted. The only issue being, since I am doing every thing using SDK, it takes a lot of API calls to get things done. I mean to solve this, first I am generating a Token and then calling this API. A simple add default "Prediction Resource" for all apps on LUIS portal would have helped a lot. Anyways, thanks for this answer. – user3868541 Feb 3 at 9:45
Agreed that an Add default Prediction Resource would have made everything much better. I'm still not sure how to do this programmatically. I'm trying to do it in my service using the SDK

Related

How to get the get API path and parameters of Google play developer API?

I have added a non-renewable subscription for one of my projects. We also started implementing the Google play developer API to get the subscription latest status from the Play Store. For that we have done the below steps as per this blog:
Linked the developer account to a new Google Cloud Project.
Enabled the Google Play Developer API for the Google Cloud Project.
Created a service account and created a key for the service account.
I have below clarifications related to this implementation:
I tried to Grant Access for the following permissions: But the corresponding checkmark is not clickable.
View financial data, orders, and cancellation survey responses
Manage orders and subscriptions
The 3rd step as per the blog is to Authorize an API key, but I didn't get a clear idea of that.
We are going to implement this API on the back end side as a corn job, do we need to generate a JWT token for accessing this API? Is this possible to call without a Token? I found 2 types of implementations from this blog, which one is easy and secure?
"Your application can complete these tasks either by using the Google APIs client library for your language or by directly interacting with the OAuth 2.0 system using HTTP."
From where we get the get API path and other details. I found a similar get API from AppStore like this. Is the play store providing a similar kind of get API?
We need the latest purchase status API and for that what parameters do we need to pass?

LUIS deployed through SharePoint - How to get user data?

We have deployed LUIS V4 in our Azure Platform, and made it available to our employee through SharePoint. It is currently open and does not need log in to be used.
We would like to capture information about who the person interacting with the bot is; is there any way that information related to the user can be retrieved? (employees to use the bot must be authenticated to Azure as it is within a SharePoint, but the bot doesn't require authentication as mentioned)
Thank you!
If you are just using LUIS, then no, it does not do any user specific tasks. It only translates an utterance (phrase) into specific actions (intents and entities), also does not store any state.
So all authorisations and user customisations need to be done outside of LUIS, with plain code. If you are using Azure/Microsoft Bot, you can hook up a channel to LUIS and use the id to identify user (skype id, phone number, microsoft teams id...)
A bit of info for connecting Azure Bot with SharePoint.

Can we develop a functional or process bot using azure service

I'm looking for a solution where my bot can understand users request(may be with LUIS this can be achieved) and verifies/validates the user/requirement with master data. If all good, then connect to my native database(Siebel CRM via API) to perform the defined action and log a reference ticket(via API) and finally send an email to user using outlook. Is this achievable using azure service?
Yes, the Bot Framework can do all of those things:
my bot can understand users request
LUIS is perfect for this.
verifies/validates the user/requirement with master data
All of this can be done within Waterfall dialogs or Prompts. You can either store the master data in the bot code, or query it from an external source and have the bot validate against it.
Here's a good sample for prompts and validation.
connect to my native database(Siebel CRM via API) to perform the defined action and log a reference ticket(via API)
The bot runs on C#/Node, so anything (including calling your APIs) that you can do in C#/Node, you can do in your bot.
send an email to user using outlook
Bot Framework has a specific Email Channel for this or you can use the Graph API.
Recommended Resources
Docs and QuickStarts
Samples Repo
Reference Docs: C# / TypeScript
LUIS Docs

Why do LUIS app lose endpoint key if I use it in several apps?

I have several LUIS apps, 6 normal and 5 dispatch. I assign the same endpoint key from a cognitive service en Azure to all of them. But it seems that there are always two that end up losing the resource somehow.
Couldn't find any documentation about a limit on how many LUIS apps can use the same endpoint at the same time.
You can assign the same subscription key/endpoint key to multiple LUIS apps assuming they are in the same region. Also, the authoring key in LUIS.ai is not the same as the endpoint LUIS subscription key in portal.azure.com. The authoring key allows you to author any LUIS app and the endpoint key allows you to query any LUIS endpoint. The endpoint key allows a quota of endpoint hits based on the usage plan you specified when creating the key. This gives you a detail on the key limits for different subscriptions.

Can Luis be used in Bots designed on platform other than MSFT Bot Framework

Can Luis be used in Bots designed on a platform other than MSFT Bot Framework like chatfeul.
After training a LUIS model, you get an endpoint which is a REST service that can be called. You can then pass parameters to this, modify it according to need and get a JSON response.
You can read more about connecting an API to chatfuel here

Resources