Alexa intent slot AMAZON.LITERAL causes failed build - alexa-skills-kit

I'm trying to use the AMAZON.LITERAL slot type in my Alexa skill, but when I try building, I see this error:
Build Failed
Slot name "{What}" is used in a sample utterance but not defined in the intent schema. Error code: UndefinedSlotName - Thursday, Apr 12, 2018, 2:08 PM
The slot is named What, and I'm 100% sure it is defined. It builds successfully if I change the slot type to anything except AMAZON.LITERAL.
Here is my entire model:
{
"interactionModel": {
"languageModel": {
"invocationName": "chores",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
},
{
"name": "Remember",
"slots": [
{
"name": "Who",
"type": "AMAZON.Person"
},
{
"name": "When",
"type": "AMAZON.DATE"
},
{
"name": "What",
"type": "AMAZON.LITERAL"
}
],
"samples": [
"remember {Who} {What} {When}"
]
}
],
"types": []
}
}
}
EDIT:
This is the response I got from Amazon when I submitted the bug:
We are not supporting AMAZON.Literal slot type anymore and we ask
developer to use customer slot type is they have some set of values
but if not then you can use AMAZON.SearchQuery where you will get the
whole query which customer is looking for and same you can use it in
you lambda function.

I faced the same issue. Here's the solution.
You need to define your Sample Utterances as
Remember {Neil | Who} {died | What} {yesterday | When}
Amazon made it mandatory to provide the example inputs along with your Slot names as AMAZON.LITERAL can take in a wide variety of values.
For more information, refer here.

add some sample utterances in below format and it should work:
remember {Jack|Who} {bring fruits|What} {tomorrow|When}
remember {Mark|Who} {pay bills|What} {today|When}

Related

How to send event parameters for a tag through the google tag manager API

With this query i can create a GTM event tag for Google Analytics 4. i would like to pass some event parameters aswell. I feel that im really close because the API seems to recognize the eventParameters key, it tells me that its value its invalid.
"vendorTemplate.parameter.eventParameters[0]: The value is invalid.\n",
If i change this eventParameters key to something else, the query goes through (obviously without taking into consideration my eventParameters) so i know that this code has to be close.
The documentation is really shallow so building queries with the GTM api its been very trial and error until now.
When i get this working i'll probably make a sample for automating trigger and tag creation for GA4 migrations
`
{
"name": "test2",
"type": "gaawe",
"parameter": [
{
"type": "template",
"key": "eventName",
"value": "hey"
},
{
"type": "tagReference",
"value": "LocalTag",
"key": "measurementId"
},
{
"type": "list",
"key": "eventParameters",
"list": [
{
"type": "template",
"value": "page_title",
"key": "page_title"
}
]
}
]
}
`
The parameters is a array
Here is the example:
{
"type": "MAP",
"map": [
{
"type": "TEMPLATE",
"key": "name",
"value": `${parameterName}`
},
{
"type": "TEMPLATE",
"key": "value",
"value": `${parameterValue}`
}
]
}
And if you want to pass a variable to the value
Just add the "{{" , "}}" as you used in GTM UI.
Like {{DataLayer-Ecommerce}}
So yes you are very close to it.

Access definitions on ref property with newtonsoft.json.schema

I want to have access to the definitions in the schema in order to get the naming of the definition. I am using newtonsoft.json v11.01
I am building a c# converter for jsonschema to make a syntaxtree and compile it in order to get a typed version of the object at runtime.
{
"$id": "https://example.com/arrays.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "xml remarks",
"type": "object",
"properties": {
"fruits": {
"type": "array",
"items": {
"type": "object",
"title": "fruit",
"required": ["naam"],
"properties": {
"naam": {
"type": "string",
"description": "The name of the fruit."
}
}
}
},
"vegetables": {
"type": "array",
"items": { "$ref": "#/definitions/veggie" }
}
},
"definitions": {
"veggie": {
"type": "object",
"required": [ "veggieName", "veggieLike" ],
"properties": {
"veggieName": {
"type": "string",
"description": "The name of the vegetable."
},
"veggieLike": {
"type": "boolean",
"description": "Do I like this vegetable?"
}
}
}
}
}
in the schema a reference is created with the name veggie. This is used in the property vegetable with a reference.
Json schema contains a definition on the root object but is doesn't have it on the property element. On the property element there is nothing identifiable to point to the right definition.
how do i find the right definition for the property?
In general, in order to resolve a json-pointer (a $ref is a "uri-reference", and the part after the # is a "json-pointer"), you need to have access to the root of the json document.
So if you currently have a function that only gets an argument that points to the "properties" section, then you need to give that function a second argument that points to the root of the document.
(It gets more complicated when you're using a schema made up of more than one file; then you need a second argument that points to the roots of all the schema documents)
It's one of the more difficult parts of writing software that interprets json-schema files, especially if your language/library doesn't have support for json-pointers built-in - you'll need to write it yourself in that case.

copyIndex() inside a listKeys()

We're trying to deploy an ARM template which deploys a Stream Analytics job with n Event Hubs outputs depending on an input parameter.
Right now we're having success with all but the listKeys() function inside the outputs property copy loop function which gets each Event Hub's primary keys:
"sharedAccessPolicyKey": "[listKeys(resourceId('Microsoft.EventHub/namespaces/eventhubs/authorizationRules', variables('clientEventHubNamespace'), parameters('clients')[copyIndex('outputs')].id, variables('clientEventHubClientSharedAccessName')), '2015-08-01').primaryKey]"
We get the error:
17:44:31 - Error: Code=InvalidTemplate; Message=Deployment template
validation failed: 'The template resource
'tailor-router-axgf7t3gtspue' at line '129' and column '10' is not
valid: The template function 'copyIndex' is not expected at this
location. The function can only be used in a resource with copy
specified. Please see https://aka.ms/arm-copy for usage details..
Please see https://aka.ms/arm-template-expressions for usage
details.'.
However, if we change this to be a specific index:
"sharedAccessPolicyKey": "[listKeys(resourceId('Microsoft.EventHub/namespaces/eventhubs/authorizationRules', variables('clientEventHubNamespace'), parameters('clients')[0].id, variables('clientEventHubClientSharedAccessName')), '2015-08-01').primaryKey]"
it works.
Is copyIndex('propertyName') inside a listKeys() a supported function?
If not, is there a workaround that would achieve the same effect?
Kind regards,
Nick
Stream Analytics job resource definition:
{
"apiVersion": "2016-03-01",
"type": "Microsoft.StreamAnalytics/StreamingJobs",
"name": "[variables('routerStreamAnalyticsName')]",
"location": "[variables('location')]",
"dependsOn": [ "clientsEventHubCopy" ],
"tags": {
"boundedContext": "[variables('boundedContextName')]"
},
"properties": {
"sku": {
"name": "[parameters('routerStreamAnalyticsSkuTier')]"
},
"outputErrorPolicy": "drop",
"eventsOutOfOrderPolicy": "adjust",
"eventsOutOfOrderMaxDelayInSeconds": 0,
"eventsLateArrivalMaxDelayInSeconds": 5,
"dataLocale": "en-US",
"compatibilityLevel": "1.0",
"inputs": [
{
"name": "input0",
"properties": {
"type": "stream",
"serialization": {
"type": "Avro"
},
"datasource": {
"type": "Microsoft.ServiceBus/EventHub",
"properties": {
"serviceBusNamespace": "[parameters('input0EventHubNamespace')]",
"sharedAccessPolicyName": "[parameters('input0EventHubSharedAccessPolicyName')]",
"sharedAccessPolicyKey": "[parameters('input0EventHubSharedAccessPolicyKey')]",
"eventHubName": "[parameters('input0EventHubName')]"
}
}
}
}
],
"transformation": {
"name": "routing",
"properties": {
"streamingUnits": "[parameters('routerStreamAnalyticsSkuTier')]",
"query": "omitted"
}
},
"copy": [
{
"name": "outputs",
"count": "[length(parameters('clients'))]",
"input": {
"name": "[parameters('clients')[copyIndex('outputs')].id]",
"properties": {
"datasource": {
"type": "Microsoft.ServiceBus/EventHub",
"properties": {
"serviceBusNamespace": "[variables('clientEventHubNamespace')]",
"sharedAccessPolicyName": "[variables('clientEventHubClientSharedAccessName')]",
"sharedAccessPolicyKey": "[listKeys(resourceId('Microsoft.EventHub/namespaces/eventhubs/authorizationRules', variables('clientEventHubNamespace'), parameters('clients')[copyIndex('outputs')].id, variables('clientEventHubClientSharedAccessName')), '2015-08-01').primaryKey]",
"eventHubName": "[parameters('clients')[copyIndex('outputs')].id]"
}
},
"serialization": {
"type": "Avro"
}
}
}
}
]
}
},
Thanks for reporting this and sorry for the inconvenience.
I just talked to the ARM team, we had an issue when copyindex was inside the index tags eg 'array[copyindex()]'. It should be fixed now.
Let us know how it goes.
Thanks,
JS - Azure Stream Analytics

Alexa skill intent does not use the list of words in my slot

Assuming I have an alexa skill with the following intents:
{
"intents": [
{
"intent": "aaa",
"slots": []
},
{
"intent": "bbb",
"slots": [
{
"name": "City",
"type": "CITIES"
}
]
},
{
"intent": "ccc",
"slots": [
{
"name": "City",
"type": "CITIES"
}
]
},
{
"intent": "ddd",
"slots": [
{
"name": "City",
"type": "CITIES"
},
{ "name": "Name",
"type": "USER_NAMES"}
]
},
]
}
Assuming I use this simple Utterances:
ddd tell me if user {Name} lives in the {City}.
By doing so I assumed that in my alexa skill as long as my Intent is calling will provide in Slot Name one of Names in my custom slot and in slot City one of the Cities in my custom slot.
However, the result is that I am getting free text which I did not provide within the custom slot. the free text if you say the words sounds like what I said, but means different things.
I am not quite sure if I am doing something wrong or if this is as designed.
Yes, this is normal and is a common source of confusion: the list of words you provide for the custom slot is taken as a guide, not a definitive set.
Since it is a source of confusion they published a blog post about it:
Why a Custom Slot is the Literal Solution
Also, note that there are built-in slot types for cities that you can use and build off of, see here:
https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/slot-type-reference

How to get output text when using watson conversation api

I have created a workspace and created the intent, entities and dialogs for a conversation service
Where we use the launch tool and "try it out", i can see the watson text response for the question i asked. But however when i use the api command via a rest client, it does not return the text output.
The input i used for the api was
{
"input": {
"text": "increase the temperature of ac"
}
}
and as response i got the following
{
"input": {
"text": "increase the temperature of ac"
}-
"context": {
"conversation_id": "5a7ce4c2-c6be-4cb8-b728-19136457bf28"
"system": {
"dialog_stack": [1]
0: "root"
-
"dialog_turn_counter": 1
"dialog_request_counter": 1
}-
}-
"entities": [1]
0: {
"entity": "appliance"
"location": [2]
0: 28
1: 30
-
"value": "ac"
}-
-
"intents": [1]
0: {
"intent": "turn_up"
"confidence": 0.9854193755106732
}-
-
"output": {
"log_messages": [0]
"text": [0]
"nodes_visited": [1]
0: "node_1_1469526692057"
-
}-
}
It doesnot have any text message in the json output
This is working as intended.
Using the Github Conversation demo, You can find the related node in the JSON by searching for "conditions": "#turn_up". Here is the related block.
{
"go_to": {
"return": null,
"selector": "condition",
"dialog_node": "node_11_1467233013716"
},
"output": {},
"parent": null,
"context": null,
"created": "2016-07-22T04:55:54.661Z",
"metadata": null,
"conditions": "#turn_up",
"description": null,
"dialog_node": "node_10_1467233003109",
"previous_sibling": "node_7_1467232789215"
},
Alternatively you can look up the block in the Conversation UI looking for #turn_up. For example.
The output field is empty. So the output text is not being handled by Conversation.
It has to be handled at the application layer. There are valid reasons for doing this. For example creating an answer store independent makes it easier for a non-technical user to update. Or if you wanted to hand off to something like Retrieve and Rank to find the answer.
In this case, how the Car demo handles this is detailed in the tutorial video, which you can see here.
https://youtu.be/wG2fuliRVNk

Resources