Comments (1)
Hey,
There are no lists in dialogflow-fulfillment
, try to use Actions on Google package or send custom payload (that's how i did it). Here's the code for my fulfillment:
const functions = require('firebase-functions')
const {WebhookClient, Card, Suggestion, Image, Payload} = require('dialogflow-fulfillment')
process.env.DEBUG = 'dialogflow:debug'
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
const agent = new WebhookClient({ request, response })
function welcome(agent) {
agent.add(`It's webhook Demo Time now!`)
agent.add(new Card({
title: 'Im card title',
text: 'Im card text',
imageUrl: "https://developers.google.com/assistant/images/badges/XPM_BADGING_GoogleAssistant_VER.png",
buttonText: 'This is a button',
buttonUrl: 'https://assistant.google.com/'
}))
agent.add(new Suggestion('Im a suggestion'))
agent.add(new Image('https://camo.githubusercontent.com/7bee509b607c0b359b2e00d3bdfd52085002f2cf/68747470733a2f2f692e696d6775722e636f6d2f4a3861544977742e706e67'))
}
function actions(agent){
agent.requestSource = agent.ACTIONS_ON_GOOGLE
agent.add(new Payload(agent.ACTIONS_ON_GOOGLE, {
expectUserResponse: true,
isSsml: false,
noInputPrompts: [],
systemIntent: {
intent: "actions.intent.OPTION",
data: {
"@type": "type.googleapis.com/google.actions.v2.OptionValueSpec",
carouselSelect: {
items: [
{
optionInfo: {
key: "SELECTION_KEY_ONE",
synonyms: [
"synonym 1",
"synonym 2",
"synonym 3"
]
},
description: "This is a description of a carousel item.",
image: {
url: "https://via.placeholder.com/150",
accessibilityText: "Image alternate text"
},
title: "Title of First Carousel Item"
},
{
optionInfo: {
key: "SELECTION_KEY_TWO",
synonyms: [
"synonym 1",
"synonym 2",
"synonym 3"
]
},
description: "This is a description of a carousel item.",
image: {
url: "https://via.placeholder.com/150",
accessibilityText: "Image alternate text"
},
title: "Title of Second Carousel Item"
},
{
optionInfo: {
key: "SELECTION_KEY_THREE",
synonyms: [
"synonym 1",
"synonym 2",
"synonym 3"
]
},
description: "This is a description of a carousel item.",
image: {
url: "https://via.placeholder.com/150",
accessibilityText: "Image alternate text"
},
title: "Title of Third Carousel Item"
}
]
}
}
},
richResponse: {
items: [
{
simpleResponse: {
textToSpeech: "This is Actions",
displayText: "Simple Response"
}
},
{
basicCard: {
title: "This is a title",
subtitle: "This is a subtitle",
formattedText: "This is a basic card.",
image: {
url: "https://via.placeholder.com/150",
accessibilityText: "Image alternate text"
},
buttons: [
{
title: "This is a button",
openUrlAction: {
"url": "https://assistant.google.com/"
}
}
],
imageDisplayOptions: "CROPPED"
}
},
{
mediaResponse: {
mediaType: "AUDIO",
mediaObjects: [
{
contentUrl: "https://storage.googleapis.com/automotive-media/Jazz_In_Paris.mp3",
description: "A funky Jazz tune",
icon: {
url: "https://storage.googleapis.com/automotive-media/album_art.jpg",
accessibilityText: "Album cover of an ccean view"
},
name: "Jazz in Paris"
}
]
}
},
{
tableCard: {
title: "Table Title",
subtitle: "Table Subtitle",
image: {
url: "https://developers.google.com/assistant/images/badges/XPM_BADGING_GoogleAssistant_VER.png",
accessibilityText: "Alt Text"
},
rows: [
{
cells: [
{
text: "row 1 item 1"
},
{
text: "row 1 item 2"
},
{
text: "row 1 item 3"
}
],
dividerAfter: false
},
{
cells: [
{
text: "row 2 item 1"
},
{
text: "row 2 item 2"
},
{
text: "row 2 item 3"
}
],
dividerAfter: true
},
{
cells: [
{
text: "row 2 item 1"
},
{
text: "row 2 item 2"
},
{
text: "row 2 item 3"
}
]
}
],
columnProperties: [
{
header: "header 1",
horizontalAlignment: "CENTER"
},
{
header: "header 2",
horizontalAlignment: "LEADING"
},
{
header: "header 3",
horizontalAlignment: "TRAILING"
}
],
buttons: [
{
title: "Button Text",
openUrlAction: {
url: "https://assistant.google.com"
}
}
]
}
},
{
carouselBrowse: {
items: [
{
title: "Title of item 1",
openUrlAction: {
url: "https://via.placeholder.com/150"
},
description: "Description of item 1",
footer: "Item 1 footer",
image: {
url: "https://via.placeholder.com/150",
accessibilityText: "Image alternate text"
}
},
{
title: "Google Assistant",
openUrlAction: {
url: "https://example.com"
},
description: "Google Assistant on Android and iOS",
footer: "More information about the Google Assistant",
image: {
url: "https://via.placeholder.com/150",
accessibilityText: "Image alternate text"
}
}
]
}
}],
suggestions: [{title: "Suggestion"}],
linkOutSuggestion: {
destinationName: "Suggestion Link",
url: "https://assistant.google.com/"
}
}
}))
}
let intentMap = new Map()
intentMap.set('Webhook Demo', welcome)
intentMap.set('Actions Demo', actions)
agent.handleRequest(intentMap)
})
from dialogflow-web-v2.
Related Issues (20)
- Vue js Native Script HOT 1
- Web app stopped working? HOT 1
- record icon is not working in safar, mozilla, edge etc. HOT 6
- Add audio input for unsupported browsers HOT 5
- Knowledge Base Support HOT 10
- Freeze chat input form when suggestion button comes out. HOT 1
- Correct Media Component HOT 1
- Time of transcription HOT 1
- IAM permission 'dialogflow.agents.get' on 'projects/small-talk-hqbbmy' denied. HOT 1
- deprecated packages HOT 1
- The deployment was not found HOT 8
- Account Linking HOT 1
- Refactor speech recognition/recording code
- Dialogflow Messenger components duplication
- Missing Avatar on Web Demo (Agent icon) HOT 1
- Dialogflow CX Support HOT 1
- Redo audio player
- Vue clie service not found HOT 1
- There is a problem with the gateway console HOT 1
- Is it possible to integrate/ embed it in an react project? How should I do that? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dialogflow-web-v2.