Receive an error after clicking carousel item - dialogflow-es

We have an action running in production just fine. It has just started returning an error after trying to click or invoke an item from a carousel.
Steps to reproduce are as follows
Talk to Action
Carosel loads fine
Invoke any item in Carousel via click or voice
receive the error
Sorry, {action} is not responding at this time. Please try again later.
Here is a snippet of how it is being built.
There is nothing reported as an error in stackdriver logs
/**
* #description Build the Carousel
* #private
* #static
* #param {CardListItem[]} listItems - Array of CardListItem to transform
* #returns {Carousel}
* Returns a Carousel
* #memberof TemplateBuilder
*/
private static getCarousel(listItems: CardListItem[]): Carousel {
const items = [] as GoogleActionsV2UiElementsCarouselSelectCarouselItem[];
listItems = this.sortListTemplateListItemsByGoogleIndexAscending(listItems);
for (const listItem of listItems) {
if (listItem.googleIndex) {
items.push(this.getCarouselItem(listItem));
}
}
return new Carousel({
items,
display: 'DEFAULT',
});
}
/**
* #description Build a CarouselItem
* #private
* #static
* #param {CardListItem} data - Template data of type ListTemplateData
* #returns {GoogleActionsV2UiElementsCarouselSelectCarouselItem}
* Returns a Carousel Item
* #memberof TemplateBuilder
*/
private static getCarouselItem(data: CardListItem): GoogleActionsV2UiElementsCarouselSelectCarouselItem {
const title = data.textContent ? this.convertToPlainText(data.textContent) : null;
const imageUrl = typeof data.image === 'string' ? data.image : data.image.imageUrl;
return {
optionInfo: {
key: data.intentHandler || data.token,
synonyms: [],
} as GoogleActionsV2OptionInfo,
image: new Image({
url: this.getImageURL(imageUrl),
alt: title,
height: null,
width: null,
}),
title,
} as GoogleActionsV2UiElementsCarouselSelectCarouselItem;
}
Response from the web hook
{
"payload": {
"google": {
"expectUserResponse": true,
"systemIntent": {
"intent": "actions.intent.OPTION",
"data": {
"#type": "type.googleapis.com/google.actions.v2.OptionValueSpec",
"carouselSelect": {
"items": [
{
"optionInfo": {
"key": "AccountBalanceIntent",
"synonyms": []
},
"image": {
"url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-account.jpg",
"accessibilityText": "Account Balance",
"height": null,
"width": null
},
"title": "Account Balance"
},
{
"optionInfo": {
"key": "UsageCostIntent",
"synonyms": []
},
"image": {
"url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-usage.jpg",
"accessibilityText": "Energy Usage",
"height": null,
"width": null
},
"title": "Energy Usage"
},
{
"optionInfo": {
"key": "BillAmountIntent",
"synonyms": []
},
"image": {
"url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-bill.jpg",
"accessibilityText": "Bill History",
"height": null,
"width": null
},
"title": "Bill History"
},
{
"optionInfo": {
"key": "EnergyInsightsIntent",
"synonyms": []
},
"image": {
"url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-insights.jpg",
"accessibilityText": "Energy Insights",
"height": null,
"width": null
},
"title": "Energy Insights"
},
{
"optionInfo": {
"key": "BillDueDateIntent",
"synonyms": []
},
"image": {
"url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-bill-due-date.jpg",
"accessibilityText": "Bill Due Date",
"height": null,
"width": null
},
"title": "Bill Due Date"
},
{
"optionInfo": {
"key": "EnergyAlertIntent",
"synonyms": []
},
"image": {
"url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-alert.jpg",
"accessibilityText": "Energy Alert",
"height": null,
"width": null
},
"title": "Energy Alert"
},
{
"optionInfo": {
"key": "EnergyTipIntent",
"synonyms": []
},
"image": {
"url": "https://aglvoiceprod.blob.core.windows.net/images/google/thumb-tip.jpg",
"accessibilityText": "Energy Tip",
"height": null,
"width": null
},
"title": "Energy Tip"
}
],
"imageDisplayOptions": "DEFAULT"
}
}
},
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "<speak>Hi Brent,<break time=\"200ms\"/> welcome to <say-as interpret-as=\"spell-out\">AGL</say-as>.<break time=\"400ms\"/> With our latest update,<break time=\"200ms\"/> you can now set up Energy Alerts.<break time=\"300ms\"/> For other ways that I can help,<break time=\"200ms\"/> say \"more information\".<break time=\"350ms\"/> How can I help you today?</speak>",
"displayText": "Hi Brent, welcome to AGL. With our latest update, you can now set up Energy Alerts. For other ways that I can help, say \"more information\". How can I help you today?"
}
}
],
"suggestions": [
{
"title": "Monthly Billing"
},
{
"title": "eBilling"
},
{
"title": "Payment Extension"
},
{
"title": "Feedback"
},
{
"title": "Help"
}
]
}
}
},
"outputContexts": [
{
"name": "projects/agl-prod-603de/agent/sessions/ABwppHESxXC8wRCVt2-hskWfsZwxEoH54G6jm_yTj2oIiETa1V3EbgRGj86H7Ys5bEKG0YrzkL0fE9Mpnhk/contexts/_actions_on_google",
"lifespanCount": 99,
"parameters": {
"data": "{\"sessionLaunched\":true,\"skippedIntents\":[],\"possibleIntents\":[],\"followUp\":{\"yes\":{\"data\":null,\"intent\":\"Unhandled\"},\"no\":{\"data\":null,\"intent\":\"Unhandled\"},\"fuelType\":{\"elec\":{\"data\":null,\"intent\":\"Unhandled\"},\"gas\":{\"data\":null,\"intent\":\"Unhandled\"},\"both\":{\"data\":null,\"intent\":\"Unhandled\"}},\"number\":{\"data\":null,\"intent\":\"Unhandled\",\"slotName\":null},\"period\":{\"data\":null,\"intent\":\"Unhandled\",\"slotName\":null}},\"lastIntent\":\"LaunchRequest\"}"
}
}
]
}
flow in simulator

Related

Shopware 6 API Create a Product with Variants

I created my products with the API and all is ok. But we have some products with variants. These looking good in the backend, but in the frontend shopware doesn't display the product. Where is my error in the payload?
Thank you for helping me!
Here is my code:
{
"write-product":
{
"entity": "product",
"action": "upsert",
"payload": [
{
"id": "17cf3bac8966cc4de52aa557f59e5fd3",
"active": true,
"deliveryTimeId": "1e04777cb17d4396b424129b2d8e3a79",
"description": "Produktbeschreibung",
"ean": null,
"featureSetId": null,
"manufacturerId": null,
"manufacturerNumber": null,
"minPurchase": 1,
"name": "Produktname",
"productNumber": "Nummer",
"releaseDate": "2022-09-28T14:12:18.03",
"stock": 999999,
"taxId": "2842fd17d5a7424795853e7fe7072448",
"price":[
{
"currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
"net": 13.77,
"gross": 16.39,
"linked": false
}
],
"categories":[
{
"id":"648875017ed54637a41c8c1f972c239f",
"name":"Kategoriename"
}
],
"configuratorSettings": [
{
"productId": "17cf3bac8966cc4de52aa557f59e5fd3",
"optionId": "2ab9df7d2dd94ad38eb53cf7dcf16e56"
},
{
"productId": "17cf3bac8966cc4de52aa557f59e5fd3",
"optionId": "0fcf784970ea448bac1f7db542df9b86"
},
{
"productId": "17cf3bac8966cc4de52aa557f59e5fd3",
"optionId": "0014aa7dc0b644b78cd4b39193f580b4"
}
],
"properties": [
{
"groupId":"ca74efd59b5545f2b4e4f532c217b2ce",
"name": "1,0 m"
},
{
"groupId":"fa7f63d697d44684a5bb74ba5a73d3c7",
"name": "2,0 mm"
},
{
"groupId":"a431bc98fe0149c3bf3ececf629e9740",
"name": "Material"
}
],
"visibilities": [
{
"id": "17cf3bac8966cc4de52aa557f59e5fd3",
"salesChannelId": "840a0403b56240b6a11502af1d46521e",
"visibility": 30
}
],
"coverId": "0f9ab99638bd0ea5e907234bf425819e",
"cover":
{
"mediaId": "0f9ab99638bd0ea5e907234bf425819e"
},
"media": [
{
"media":
{
"id": "0f9ab99638bd0ea5e907234bf425819e",
"position": 0,
"mediaFolderId": "d8f460870e454c0bbca540614ca30029",
"alt": "Bildname",
"description": "Bildbeschreibung",
"title": "Bildtitel"
}
}
],
"children": [
{
"id": "25c8876fb7577cad78df7539737d25ce",
"active": true,
"deliveryTimeId": "1e04777cb17d4396b424129b2d8e3a79",
"description": "Beschreibung Kindelement",
"ean": null,
"featureSetId": null,
"manufacturerId": null,
"manufacturerNumber": null,
"minPurchase": 1,
"name": "Name Kindelement",
"productNumber": "Nummer Kindelement",
"releaseDate": "2022-09-16T14:14:31.41",
"stock": 999999,
"taxId": "2842fd17d5a7424795853e7fe7072448",
"price":[
{
"currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
"net": 82.63,
"gross": 98.33,
"linked": false
}
],
"categories":[
{
"id":"648875017ed54637a41c8c1f972c239f",
"name":"Kategoriename"
}
],
"configuratorSettings": [
{
"productId": "25c8876fb7577cad78df7539737d25ce",
"optionId": "b224173313cb4f8da03578ef83702751"
},
{
"productId": "25c8876fb7577cad78df7539737d25ce",
"optionId": "0fcf784970ea448bac1f7db542df9b86"
},
{
"productId": "25c8876fb7577cad78df7539737d25ce",
"optionId": "0014aa7dc0b644b78cd4b39193f580b4"
}
],
"properties": [
{
"groupId":"ca74efd59b5545f2b4e4f532c217b2ce",
"name": "6,0 m"
},
{
"groupId":"fa7f63d697d44684a5bb74ba5a73d3c7",
"name": "2,0 mm"
},
{
"groupId":"a431bc98fe0149c3bf3ececf629e9740",
"name": "Material"
}
],
"parentId": "17cf3bac8966cc4de52aa557f59e5fd3",
"options": [
{
"id":"b224173313cb4f8da03578ef83702751",
"group": {
"id":"ca74efd59b5545f2b4e4f532c217b2ce"}
},
{
"id":"0fcf784970ea448bac1f7db542df9b86",
"group": {
"id":"fa7f63d697d44684a5bb74ba5a73d3c7"}
},
{
"id":"0014aa7dc0b644b78cd4b39193f580b4",
"group": {
"id":"a431bc98fe0149c3bf3ececf629e9740"
}
}
],
"visibilities": [
{
"id": "25c8876fb7577cad78df7539737d25ce",
"salesChannelId": "840a0403b56240b6a11502af1d46521e",
"visibility": 30
}
],
"media": [
{
"media": {
"id": "fba6e74294488b554aa88f7dcf6f38f2",
"position": 0,
"mediaFolderId": "d8f460870e454c0bbca540614ca30029",
"alt": "Bildname Kindelement",
"description": "Beschreibung Kindelement",
"title": "Bildtitel Kindelement"
}
}
]
}
]
}
]
}
}
I'm searching in different boards and looking in the API Browser, Using swagger for the api and so on. No result. I need the main-product and the variants be visible in the frontend. At the moment all products with variants are invisible in the frontend.
Double check your Visibility & Categories. It could be them. Also, maybe you need to re-index after creation?
You have way too much stuff going on at the moment for us to help you out.
Try to split your calls into smaller chunks (for us). Also start with less data when creating a product. With every step check the frontend. Can you even create a simple product & display it on the frontend? Yes? Then try create the most basic child that inherits most of the visible parent.
For a child you do not need much data, e.g.
{
"write-product": {
"entity": "product",
"action": "upsert",
"payload": [
{
"parentId": "",
"options": [
{
"id": ""
}
],
"price": [
{
"currencyId": "{{gen_salesChannel_currency_id}}",
"gross": 0.0,
"net": 0.0,
"linked": false
}
]
"productNumber": "",
"stock": 999
}
]
}
}
Another tip is to use the network tab in the admin to see how it creates these relationships. Here is an image of how it looks like:

Facing an error while building a custom skil for amazon alexa

I am trying to a build a basic custom alexa skill. I have created an intent schema and am using AWS lambda function as the endpoint. ]
My Intent schema:
{
"interactionModel": {
"languageModel": {
"invocationName": "toit brewpub",
"modelConfiguration": {
"fallbackIntentSensitivity": {
"level": "LOW"
}
},
"intents": [
{
"name": "AMAZON.FallbackIntent",
"samples": []
},
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
},
{
"name": "AMAZON.NavigateHomeIntent",
"samples": []
},
{
"name": "GetClosingTime",
"slots": [],
"samples": [
"what time do you close",
"when is the last order",
"till what time are you open",
"What time does the pub close"
]
},
{
"name": "GetPriceOfBeer",
"slots": [
{
"name": "beer",
"type": "BEERS"
}
],
"samples": [
"how much is {beer}",
"what is the price of {beer}"
]
}
],
"types": [
{
"name": "BEERS",
"values": [
{
"name": {
"value": "Toit Red"
}
},
{
"name": {
"value": "Tiot Weiss"
}
},
{
"name": {
"value": "Basmati Blonde"
}
},
{
"name": {
"value": "Tintin Toit"
}
},
{
"name": {
"value": "IPA"
}
},
{
"name": {
"value": "Dark Knight"
}
}
]
}
]
}
}
}
I am using Node.js v 10.x for my lamda function which has been built using Alexa-Skills-NodeJS-Fact-kit, The region for my aws lambda is US_EAST- N.VIRGINIA.
Below is the request I receive when I talk to my Test Simulator:
{
"version": "1.0",
"session": {
"new": false,
"sessionId": "amzn1.echo-api.session.fd1c5315-ecf8-413f-ba25-e54bd6ae316a",
"application": {
"applicationId": "amzn1.ask.skill.72615503-5f38-4baf-b0dd-cd6edd3b6dfd"
},
"user": {
"userId": ""
}
},
"context": {
"System": {
"application": {
"applicationId": "amzn1.ask.skill.72615503-5f38-4baf-b0dd-cd6edd3b6dfd"
},
"user": {
"userId": ""
},
"device": {
"deviceId": "",
"supportedInterfaces": {}
},
"apiEndpoint": "https://api.eu.amazonalexa.com",
"apiAccessToken": ""
},
"Viewport": {
"experiences": [
{
"arcMinuteWidth": 246,
"arcMinuteHeight": 144,
"canRotate": false,
"canResize": false
}
],
"shape": "RECTANGLE",
"pixelWidth": 1024,
"pixelHeight": 600,
"dpi": 160,
"currentPixelWidth": 1024,
"currentPixelHeight": 600,
"touch": [
"SINGLE"
],
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
}
},
"Viewports": [
{
"type": "APL",
"id": "main",
"shape": "RECTANGLE",
"dpi": 160,
"presentationType": "STANDARD",
"canRotate": false,
"configuration": {
"current": {
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
},
"size": {
"type": "DISCRETE",
"pixelWidth": 1024,
"pixelHeight": 600
}
}
}
}
]
},
"request": {
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.24b64895-3f90-4a5b-9805-9d3b038cd323",
"timestamp": "2020-03-29T08:59:54Z",
"locale": "en-US",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
}
I have removed the user Id, device ID and access token while asking the question for security reasons.
My Lambda node js function looks like this which i have generated using the code generator :
https://github.com/shreyneil/Episodes/blob/master/amazon-echo/lambda-function.js
Url for code-generator: http://alexa.codegenerator.s3-website-us-east-1.amazonaws.com/
Url for tutorial that i was using to implement it: https://www.youtube.com/watch?v=BB3wwxgqPOU
Whenever i try to launch the event using , open toit brewpub in my test simulator it thorws an error stating :
There was a problem with the requested skill's response
Any idea on how to make this work?
Any leads would appreciated, Thank you!

Dialogflow textToSpeech fulfilment not reading aloud the text

I am providing users with a response on an audio only device (e.g. google home), when I respond with a textToSpeech field within a simpleResponse, the speech is not read out in the simulator.
Has anyone experienced this and know how to fix?
I've tried different response types but none of them read out the textToSpeech field.
Also tried ticking/unticking end conversation toggle in Dialogflow and expectUserInput true/false when responding with JSON to no avail.
The response is currently fulfilled by a webhook which responds with JSON v2 fulfilment blob and the simulator receives the response with no errors but does not read it out.
RESPONSE -
{
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Here are the 3 closest restaurants that match your criteria,"
}
}
]
}
}
}
}
REQUEST -
{
"responseId": "404f3b65-73a5-47db-9c17-0fc8b31560a5",
"queryResult": {
"queryText": "actions_intent_NEW_SURFACE",
"parameters": {},
"allRequiredParamsPresent": true,
"outputContexts": [
{
"name": "projects/my-project/agent/sessions/sessionId/contexts/findrestaurantswithcuisineandlocation-followup",
"lifespanCount": 98,
"parameters": {
"location.original": "Shoreditch",
"cuisine.original": "international",
"cuisine": "International",
"location": {
"subadmin-area": "Shoreditch",
"subadmin-area.original": "Shoreditch",
"subadmin-area.object": {}
}
}
},
{
"name": "projects/my-project/agent/sessions/sessionId/contexts/actions_capability_account_linking"
},
{
"name": "projects/my-project/agent/sessions/sessionId/contexts/actions_capability_audio_output"
},
{
"name": "projects/my-project/agent/sessions/sessionId/contexts/google_assistant_input_type_voice"
},
{
"name": "projects/my-project/agent/sessions/sessionId/contexts/actions_capability_media_response_audio"
},
{
"name": "projects/my-project/agent/sessions/sessionId/contexts/actions_intent_new_surface",
"parameters": {
"text": "no",
"NEW_SURFACE": {
"#type": "type.googleapis.com/google.actions.v2.NewSurfaceValue",
"status": "CANCELLED"
}
}
}
],
"intent": {
"name": "projects/my-project/agent/intents/0baefc9d-689c-4c33-b2b8-4e130f626de1",
"displayName": "Send restaurants to mobile"
},
"intentDetectionConfidence": 1,
"languageCode": "en-us"
},
"originalDetectIntentRequest": {
"source": "google",
"version": "2",
"payload": {
"isInSandbox": true,
"surface": {
"capabilities": [
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.MEDIA_RESPONSE_AUDIO"
},
{
"name": "actions.capability.ACCOUNT_LINKING"
}
]
},
"requestType": "SIMULATOR",
"inputs": [
{
"rawInputs": [
{
"query": "no",
"inputType": "VOICE"
}
],
"arguments": [
{
"extension": {
"#type": "type.googleapis.com/google.actions.v2.NewSurfaceValue",
"status": "CANCELLED"
},
"name": "NEW_SURFACE"
},
{
"rawText": "no",
"textValue": "no",
"name": "text"
}
],
"intent": "actions.intent.NEW_SURFACE"
}
],
"user": {
"userStorage": "{\"data\":{}}",
"lastSeen": "2019-04-12T14:31:23Z",
"locale": "en-US",
"userId": "userID"
},
"conversation": {
"conversationId": "sessionId",
"type": "ACTIVE",
"conversationToken": "[\"defaultwelcomeintent-followup\",\"findrestaurantswithcuisineandlocation-followup\",\"findrestaurantswithcuisineandlocation-followup-2\"]"
},
"availableSurfaces": [
{
"capabilities": [
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.SCREEN_OUTPUT"
},
{
"name": "actions.capability.WEB_BROWSER"
}
]
}
]
}
},
"session": "projects/my-project/agent/sessions/sessionId"
}
I expect the simulator to read out the result of textToSpeech but currently does not.

My Alexa intent has no slot defined, no matter what I ask

I'm using a custom Lambda function to handle my custom Alexa skill. I have a single slot, which I want to capture. Unfortunately, the intent slot is never populated with any value, and seems to be getting ignored, despite being in the request.
Here is my code (note: the JSON.stringify is there to help me debug):
'use strict';
var Alexa = require("alexa-sdk");
exports.handler = function(event, context, callback) {
var alexa = Alexa.handler(event, context);
alexa.registerHandlers(handlers);
alexa.execute();
};
var handlers = {
'LaunchRequest': function () {
this.emit('Snow');
},
'Snow': function () {
var place = this.event.request.intent.slots.Place;
var text = 'Over the next 9 days you can expect 12 centimeters of snowfall in '+ JSON.stringify(place) +'. The upper piste has a depth of 75 centimeters and the lower piste has a depth of 35 centimeters. All 19 lifts are currently open.';
this.emit(':tell', text);
}
};
I have an Intent called "Snow" and a slot called "Place". Here is my interaction model:
{
"interactionModel": {
"languageModel": {
"invocationName": "ski club",
"intents": [
{
"name": "AMAZON.FallbackIntent",
"samples": []
},
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
},
{
"name": "AMAZON.NavigateHomeIntent",
"samples": []
},
{
"name": "Snow",
"slots": [
{
"name": "Place",
"type": "AMAZON.City"
}
],
"samples": [
"how the powder is",
"what the powder is like",
"how the snow is",
"what the snow is like",
"snow conditions",
"snow condition",
"snow fall",
"snowfall",
"powder levels",
"powder level",
"snow level",
"powder depth",
"snow levels",
"snow depth",
"powder",
"snow",
"the snow"
]
}
],
"types": []
},
"dialog": {
"intents": [
{
"name": "Snow",
"confirmationRequired": false,
"prompts": {},
"slots": [
{
"name": "Place",
"type": "AMAZON.City",
"confirmationRequired": false,
"elicitationRequired": true,
"prompts": {
"elicitation": "Elicit.Slot.115004419453.153941565683"
}
}
]
}
]
},
"prompts": [
{
"id": "Elicit.Slot.115004419453.153941565683",
"variations": [
{
"type": "PlainText",
"value": "Where would you like to know about the snow?"
}
]
}
]
}
}
I would expect to be able to ask:
Alexa ask my app how the snow is in Morzine
And I would expect an answer back with the static text from my Lambda function, including the name inserted. However, I'm getting the following:
{
"body": {
"version": "1.0",
"response": {
"outputSpeech": {
"type": "SSML",
"ssml": "<speak> Over the next 9 days you can expect 12 centimeters of snowfall in {\"name\":\"Place\",\"confirmationStatus\":\"NONE\"}. The upper piste has a depth of 75 centimeters and the lower piste has a depth of 35 centimeters. All 19 lists are currently open. </speak>"
},
"shouldEndSession": true
},
"sessionAttributes": {},
"userAgent": "ask-nodejs/1.0.25 Node/v8.10.0"
}
}
It seems Place never has a value.
I get the exact same response if I omit the Place slot entirely:
Alexa ask my app how the snow is
Here I would expect to be asked to give a slot.
Here is the JSON Input from Alexa (I've redacted some keys):
{
"version": "1.0",
"session": {
"new": true,
"sessionId": "amzn1.echo-api.session.***",
"application": {
"applicationId": "amzn1.ask.skill.***"
},
"user": {
"userId": "amzn1.ask.account.***"
}
},
"context": {
"System": {
"application": {
"applicationId": "amzn1.ask.skill.***"
},
"user": {
"userId": "amzn1.ask.account.***"
},
"device": {
"deviceId": "amzn1.ask.device.***",
"supportedInterfaces": {}
},
"apiEndpoint": "https://api.eu.amazonalexa.com",
"apiAccessToken": "***.***.***
},
"Viewport": {
"experiences": [
{
"arcMinuteWidth": 246,
"arcMinuteHeight": 144,
"canRotate": false,
"canResize": false
}
],
"shape": "RECTANGLE",
"pixelWidth": 1024,
"pixelHeight": 600,
"dpi": 160,
"currentPixelWidth": 1024,
"currentPixelHeight": 600,
"touch": [
"SINGLE"
]
}
},
"request": {
"type": "IntentRequest",
"requestId": "amzn1.echo-api.request.92fc43d8-0dc2-4a08-a31a-70a031e2fef7",
"timestamp": "2018-11-16T16:51:17Z",
"locale": "en-GB",
"intent": {
"name": "Snow",
"confirmationStatus": "NONE",
"slots": {
"Place": {
"name": "Place",
"confirmationStatus": "NONE"
}
}
},
"dialogState": "STARTED"
}
}
My intents need to include the slot itself, it isn't assumed to be in there like I thought. This is done by appending {Place}.

How to make a carousel using Google.Cloud.Dialogflow.V2 Carousel for dialogflow?

Im trying to build a webhook for dialogflow with help from nuget package Google.Cloud.Dialogflow.V2.
Im running the code with .Net Core 2.1.
I get the fullfilmentText to show in dialogflow, but cant make the carousel to show up.
What am I doing wrong?
Here is my method:
[HttpPost]
public ContentResult Post([FromBody] WebhookRequest webhookRequest)
{
var dialogflowResponse = new WebhookResponse { FulfillmentText = "FulfillmentText" };
var carousel = new Intent.Types.Message.Types.CarouselSelect.Types.Item
{
Title = "My title",
Description = "This is a description",
Image = new Intent.Types.Message.Types.Image
{
ImageUri = "https://placekitten.com/200/300",
AccessibilityText = "cat"
},
Info = new Intent.Types.Message.Types.SelectItemInfo
{
Key = "Cats"
}
};
carousel.Info.Synonyms.Add("Synonym 1");
carousel.Info.Synonyms.Add("Synonym 1");
dialogflowResponse.FulfillmentMessages.Add(new Intent.Types.Message {
CarouselSelect = new Intent.Types.Message.Types.CarouselSelect()
});
dialogflowResponse.FulfillmentMessages.First().CarouselSelect.Items.Add(carousel);
return dialogflowResponse;
}
Generates followiing Json:
{
"fulfillmentText": "FulfillmentText",
"fulfillmentMessages": [
{
"carouselSelect": {
"items": [
{
"info": {
"key": "Cats",
"synonyms": [
"Synonym 1",
"Synonym 1"
]
},
"title": "My title",
"description": "This is a description",
"image": {
"imageUri": "https://placekitten.com/200/300",
"accessibilityText": "cat"
}
}
]
}
}
]
}
i ran into the same problem with the java api. Only the basic rich messages (card, quick replies, ...) are working. BasicCard, Suggestions, Carousel, ... doesn't show up in any channel.
I got it to work if i added some of the following custom payload to skype channel:
{
"skype": {
"type": "message",
"attachmentLayout": "carousel",
"text": "Please select your food.",
"attachments": [{
"contentType": "application/vnd.microsoft.card.hero",
"content": {
"title": "Sushi",
"subtitle": "Very fresh shrimp or tuna.",
"images": [{
"url": "https://i.ibb.co/87LmvT3/mdi.png"
}
],
"buttons": [{
"type": "imBack",
"title": "1 piece",
"value": "sushi,1"
}, {
"type": "imBack",
"title": "2 piece",
"value": "sushi,2"
}, {
"type": "imBack",
"title": "more",
"value": "sushi,3+"
}
]
}
}, {
"contentType": "application/vnd.microsoft.card.hero",
"content": {
"title": "Tenpura",
"subtitle": "Japanese first-class vegitables.",
"images": [{
"url": "https://i.ibb.co/87LmvT3/mdi.png"
}
],
"buttons": [{
"type": "imBack",
"title": "1 piece",
"value": "tenpura,1"
}, {
"type": "imBack",
"title": "2 piece",
"value": "tenpura,2"
}, {
"type": "imBack",
"title": "more",
"value": "tenpura,3+"
}
]
}
}
]
}}
I hope it helps!

Resources