View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('@google-cloud/functions-framework'); | |
// Here's where you set the entry point, it gets the request from Dialogflow CX | |
// and it holds the response which will be sent back to Dialogflow | |
functions.http('orderState', (req, res) => { | |
let msg; | |
let results = {}; | |
//let item; | |
//Let's log whatever we receive from Dialogflow CX to understand things better |
View actions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"actions": [ | |
{ | |
"description": "Default Welcome Intent", | |
"name": "MAIN", | |
"fulfillment": { | |
"conversationName": "welcome" | |
}, | |
"intent": { | |
"name": "actions.intent.MAIN", |
View actions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"actions": [ | |
{ | |
"description": "Default Welcome Intent", | |
"name": "MAIN", | |
"fulfillment": { | |
"conversationName": "welcome" | |
}, | |
"intent": { | |
"name": "actions.intent.MAIN", |
View chat.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:dialogflow_grpc/v2beta1.dart'; | |
import 'package:dialogflow_grpc/generated/google/cloud/dialogflow/v2beta1/session.pb.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
import 'package:rxdart/rxdart.dart'; | |
import 'package:sound_stream/sound_stream.dart'; | |
//TODO import Dialogflow | |
import 'package:dialogflow_grpc/dialogflow_grpc.dart'; |
View generate-protos-.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ ! -d "$PROTOBUF" ]; then | |
echo "Please set the PROTOBUF environment variable to your clone of google/protobuf." | |
exit -1 | |
fi | |
if [ ! -d "$GOOGLEAPIS" ]; then | |
echo "Please set the GOOGLEAPIS environment variable to your clone of googleapis/googleapis." | |
exit -1 |
View dialogflow_v2.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:meta/meta.dart'; | |
import 'package:googleapis_auth/auth_io.dart' as auth; | |
import "package:googleapis/dialogflow/v2.dart"; | |
import 'package:uuid/uuid.dart'; | |
import 'package:flutter/services.dart' show rootBundle; | |
import 'dart:convert'; | |
class Dialogflow { | |
final String serviceAccountPath; |
View 000-default-le-ssl.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_ssl.c> | |
<VirtualHost *:443> | |
# The ServerName directive sets the request scheme, hostname and port that | |
# the server uses to identify itself. This is used when creating | |
# redirection URLs. In the context of virtual hosts, the ServerName | |
# specifies what hostname must appear in the request's Host: header to | |
# match this virtual host. For the default virtual host (this file) this | |
# value is not decisive as it is used as a last resort host regardless. | |
# However, you must set it for any further virtual host explicitly. | |
#ServerName www.example.com |
View .dockerignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dockerfile | |
README.md | |
node_modules | |
npm-debug.log |
View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const functions = require('firebase-functions'); | |
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements | |
function handleRequest(map, request){ | |
let intent; | |
if(request.body && request.body.queryResult && request.body.queryResult.intent){ | |
intent = request.body.queryResult.intent.displayName; | |
} |
View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const { | |
dialogflow, | |
BasicCard, | |
Button, | |
Image, | |
Suggestions | |
} = require('actions-on-google'); |
NewerOlder