Alexa Intent Schema: Random input being identified as intents - alexa

I have two intents that use the same slot types. However, if the input is a random string, Alexa automatically identifies an intent in its JSON request even though it is not part of the utterances. For example, in the example below, if the user input was 'bla bla bla', GetAccountBalance is identified as the intent with no slot value even though it is not part of provided utterances.
What is the way to error-check for these cases and what is the best practice to avoid cases like this when developing the intent schema? Is there a way to create an intent that can handle all random inputs?
Example Schema:
{
"intents": [
{
"intent": "GetAccountBalance",
"slots": [
{
"name": "AccountType",
"type": "ACCOUNT_TYPE"
}
]
},
{
"intent": "GetAccountNumber",
"slots": [
{
"name": "AccountType",
"type": "ACCOUNT_TYPE"
}
]
}
]
}
Utterances:
GetAccountBalance what is my account balance for {AccountType} Account
GetAccountBalance what is my balance for {AccountType} Account
GetAccountBalance what is the balance for my {AccountType} Account
GetAccountBalance what is {AccountType} account balance
GetAccountBalance what is my account balance
GetAccountBalance what is account balance
GetAccountBalance what is the account balance
GetAccountBalance what is account balance
GetAccountNumber what is my account number for {AccountType} Account
GetAccountNumber what is my number for {AccountType} Account
GetAccountNumber what is the number for my {AccountType} Account
GetAccountNumber what is {AccountType} account number
GetAccountNumber what is my account number
GetAccountNumber what is account number
GetAccountNumber what is the account number
GetAccountNumber what is account number

There is one hack to resolve this problem:
If no any match found(random string) Amazon always take intent with highest no of utterances.
So I created one intent 'DidNotUnderstand' and add as many random utterances as I can (Be moderate enough) in result if no any match found alexa will call 'DidNotUnderstand' intent.
Please refer first reply from below link:
https://forums.developer.amazon.com/questions/4856/intent-triggering-without-utterance-match.html

When developing an Alexa skill, Alexa will always pick an intent to fire even if the user speaks pure gibberish. As far as I'm aware, there isn't a way to set a default / catch-all intent.
In terms of error handling, the following passage from the docs is really important.
Note that a custom slot type is not the equivalent of an enumeration. Values outside the list are still returned if recognised by the spoken language understanding system. Although input to a custom slot type is weighted towards the values in the list, it is not constrained to just the items on the list. Your code still needs to include validation and error checking when using slot values.
The link above also has a few follow up links which dive further into the topic error handling.

As per the documentation:
The AMAZON.FallbackIntent (available in English (US) only) is triggered when the user's spoken input does not match any of the other intents in the skill. AMAZON.FallbackIntent is matched to an automatically-generated out-of-domain model.
Code snippet:
'AMAZON.FallbackIntent': function (intent, session, response) {
response.ask("Optimus Prime didn't get that one....","");
}

A slot with SearchQuery slot type may help you.but it would need some extra phrases with it.like
Fname->where Fname is a slot of type Amazon.SearchQuery
my name is {Fname}
it will work for the example
my name is bffblselsk
my name is snfdslnel
etc...
visit Amazon.SearchQuery Slot for more referrences....

Related

Azure Analysis Services (AAS) Cube Roles: How to grant 2 levels of access, without having overlapping users, who thus get the lower level of access?

Situation is:
We have an AAS cube. We want some users to have access to everything, and some to have limited access. Am currently doing this via roles:
[Role- All Access]: Has access to everything. Very limited number of users; hand curated by the business
[Role- Limited Access]: Has a few tables restricted. Many users; business has ~10 existing security groups whose members should have this access.
This issue is security is reductive.
If someone is a member of both [Role- All Access] and one of the security groups that rolls up to [Role- Limited Access], that user ends up with Limited Access. At least the way I know to write the roles.
My first thought was to do add an single security group to each role:
[Role- All Access]: Gets [Security Group, All Access], which itself is hand curated
[Role- Limited Access]: Gets [Security Group, Limited Access]. This ones gets those 10 security group nested in it. But do this as a Dynamic User AAD Security Group, and exclude any one who is a member of [Security Group, All Access], via the new memberof property - but from what I read:
https://identity-man.eu/2022/06/07/using-the-new-azure-ad-dynamic-groups-memberof-property/
You can’t use other operators with memberOf (i.e. you cannot create a rule which states member Of group A can’t be in Dynamic group B).
So that doesn't work.
I may be thinking about this the entirely wrong way as well (neither AAS nor dynamic security groups are things I know much about). Thoughts?
EDIT: Maybe the way I wrote the role, is causing security to be reductive? If security were not reductive, that would make it easy.
{
"create": {
"parentObject": {
"database": "redacted"
},
"role": {
"name": "Role - Limited Access",
"modelPermission": "read",
"members": [
{
"memberName": "obj:blablaSecurityGroupGUID",
"identityProvider": "AzureAD"
}
],
"tablePermissions": [
{
"name": "FACTGeneralLedger",
"metadataPermission": "none"
}
]
}
}
}
Somehow having the [Role- All Access] as read and process was screwing something up. Switching it to just read, and the security switched back to additive.

Database design: Send the ID or the Value in a relationship

this is a design question.
Imagine this, I have two tables.
|user|
------
|id|
|username|
|team_id|
|team|
------
|id|
|name|
So when receiving a POST /users
Should I send
{
"username": "newUser",
"name": "myTeam" /
}
Get the team id first or includes if using ORMs
or
{
"username": "newUser",
"team_id": 1 // references the "myTeam"
}
Insert it directly and if the team_id doesn't exists fail
Which one is the best and why?
This is just an example with only one relationship and it could happen that the user table has a lot of relationships
It depends upon which data is important and which isn't. If your front end wants to show the name of the team then send the name of the team or if it just wants to show the id then just send the id.
In my opinion, you should send the name because it will be much more clear to the user than just the id.

Get Display Name for License SKU in Microsoft Graph

I am trying to use Microsoft Graph to capture the products which we have licenses for.
While I can get the skupartname, that name is not exactly display-friendly.
I have come across DisplayName as a datapoint in almost all the API calls that give out an object with an id.
I was wondering if there was a DisplayName for the skus, and where I could go to get them via the graph.
For reference, the call I made was on the https://graph.microsoft.com/v1.0/subscribedSkus endpoint following the doc https://learn.microsoft.com/en-us/graph/api/subscribedsku-list?view=graph-rest-1.0
The following is what's returned (after filtering out things I don't need), and as mentioned before, while I have a unique identifier which I can use via the skuPartNumber, that is not exactly PRESENTABLE.
You might notice for some of the skus, it difficult to figure out what it is referring to based on the names in the image of the Licenses page posted after the output
[
{
"capabilityStatus": "Enabled",
"consumedUnits": 0,
"id": "aca06701-ea7e-42b5-81e7-6ecaee2811ad_2b9c8e7c-319c-43a2-a2a0-48c5c6161de7",
"skuId": "2b9c8e7c-319c-43a2-a2a0-48c5c6161de7",
"skuPartNumber": "AAD_BASIC"
},
{
"capabilityStatus": "Enabled",
"consumedUnits": 0,
"id": "aca06701-ea7e-42b5-81e7-6ecaee2811ad_df845ce7-05f9-4894-b5f2-11bbfbcfd2b6",
"skuId": "df845ce7-05f9-4894-b5f2-11bbfbcfd2b6",
"skuPartNumber": "ADALLOM_STANDALONE"
},
{
"capabilityStatus": "Enabled",
"consumedUnits": 96,
"id": "aca06701-ea7e-42b5-81e7-6ecaee2811ad_0c266dff-15dd-4b49-8397-2bb16070ed52",
"skuId": "0c266dff-15dd-4b49-8397-2bb16070ed52",
"skuPartNumber": "MCOMEETADV"
}
]
Edit:
I am aware that I can get "friendly names" of SKUs in the following link
https://learn.microsoft.com/en-us/azure/active-directory/users-groups-roles/licensing-service-plan-reference
The problem is that it contains ONLY the 70ish most COMMON SKUs (in the last financial quarter), NOT ALL.
My organization alone has 5 SKUs not present on that page, and some of our clients for who we are an MSP for, also have a few. In that context, the link really does not solve the problem, since it is not reliable, nor updated fast enough for new SKUs
You can see a match list from Product names and service plan identifiers for licensing.
Please note that:
the table lists the most commonly used Microsoft online service
products and provides their various ID values. These tables are for
reference purposes and are accurate only as of the date when this
article was last updated. Microsoft does not plan to update them for
newly added services periodically.
Here is an extra list which may be helpful.
There is a CSV download available of the data on the "Product names and service plan identifiers for licensing" page now.
For example, the current CSV (as of the time of posting this answer) is located at https://download.microsoft.com/download/e/3/e/e3e9faf2-f28b-490a-9ada-c6089a1fc5b0/Product%20names%20and%20service%20plan%20identifiers%20for%20licensing%20v9_22_2021.csv. This can be downloaded, cached and parsed in your application to resolve the product display name.
This is just a CSV format of the same table that is displayed on the webpage, which is not comprehensive, but it should have many of the products listed. If you find one that is missing, you can use the "Submit feedback for this page" button on the bottom of the page to create a GitHub issue. The documentation team usually responds in a few weeks.
Microsoft may provide an API for this data in the future, but it's only in their backlog. (source)

Sell specifying the "total" instead of the "amount" parameter

According to the "Place sell order" documentation, you can either use amount as parameter, or total:
amount string Required Sell amount
total string Optional Sell amount with fees (alternative to amount)
Using the Ruby client, I made a call
client.sell(account.id,{
"total" => some_value,
"currency" => "ETH",
"payment_method" => fiat_payment_method_id
});
to sell some ETH back to USD. I got the following error message
.../lib/coinbase/wallet/api_client.rb:402:in `block in sell': Missing parameter: amount (Coinbase::Wallet::APIError)
Am I misreading the documentation ? Do I need to specify both account and total, and will the server use the total and ignore the amount ?
Or is the documentation just wrong ?
Didn't realise the error was throwing by the Ruby code and not by the Coinbase server.
Looks like the code enforced the presence of the amount parameter.
Submitted a pull request to get this fixed. Testing with my own local modified version of their gem indicates that the server works just fine with using "total" instead of "amount".

Amazon MWS Product API : How to determine Prime eligible

I have been currently working with the Amzon MWS Product API for getting the lowest listing price. I would just want to know if there is a way that i can determine that this price is Prime eligible? Thanks in advance for the help.
By using the Product API you cannot identify whether the item is prime eligible or not, but instead you can try the following API calls to get the price offers
GetLowestOfferListingsForSKU
If you are using Product Advertising API, You can perform an ItemSearch the ResponseGroup will contain IsEligibleForSuperSaverShipping which will tell you if it is Prime eligible.
Note:- Before associating prime items, you have to migrate to new shipping settings
You can perform an ItemSearch, the ResponseGroup will contain IsEligibleForSuperSaverShipping which tells you if it is Prime eligible.

Resources