Guest User

Untitled

a guest
Oct 19th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. firebase > fulfillment({method: 'POST',json: true,body:
  2. require("project/collabrec/testData.json")});
  3. Sent request to function.
  4. firebase > info: User function triggered, starting execution
  5. info: Fallback intent triggered.
  6. info: Execution took 15 ms, user function completed successfully
  7.  
  8. RESPONSE RECEIVED FROM FUNCTION: 200, {
  9. "payload": {
  10. "google": {
  11. "expectUserResponse": true,
  12. "richResponse": {
  13. "items": [
  14. {
  15. "simpleResponse": {
  16. "textToSpeech": "I didn't quite catch that. Could you say that again?"
  17. }
  18. }
  19. ]
  20. }
  21. }
  22. }
  23. }
  24.  
  25. {
  26. "user": {
  27. "userId": "ABwppHFR0lfRsG_UM3NkvAptIkD2iUpIUNxFt-ia05PFuPajV6kRQKXu_H_ECMMe0lP_WcCsK64sH2MEIg8eqA",
  28. "locale": "en-US",
  29. "lastSeen": "2018-10-19T15:20:12Z"
  30. },
  31. "conversation": {
  32. "conversationId": "ABwppHHerN4CIsBZiWg7M3Tq6NwlTWkfN-_zLIIOBcKbeaz4ruymv-nZ4TKr6ExzDv1tOzszsfcgXikgqRJ9gg",
  33. "type": "ACTIVE",
  34. "conversationToken": "[]"
  35. },
  36. "inputs": [
  37. {
  38. "intent": "actions.intent.TEXT",
  39. "rawInputs": [
  40. {
  41. "inputType": "KEYBOARD",
  42. "query": "hello"
  43. }
  44. ],
  45. "arguments": [
  46. {
  47. "name": "text",
  48. "rawText": "hello",
  49. "textValue": "hello"
  50. }
  51. ]
  52. }
  53. ],
  54. "surface": {
  55. "capabilities": [
  56. {
  57. "name": "actions.capability.MEDIA_RESPONSE_AUDIO"
  58. },
  59. {
  60. "name": "actions.capability.SCREEN_OUTPUT"
  61. },
  62. {
  63. "name": "actions.capability.AUDIO_OUTPUT"
  64. },
  65. {
  66. "name": "actions.capability.WEB_BROWSER"
  67. }
  68. ]
  69. },
  70. "isInSandbox": true,
  71. "availableSurfaces": [
  72. {
  73. "capabilities": [
  74. {
  75. "name": "actions.capability.SCREEN_OUTPUT"
  76. },
  77. {
  78. "name": "actions.capability.AUDIO_OUTPUT"
  79. },
  80. {
  81. "name": "actions.capability.WEB_BROWSER"
  82. }
  83. ]
  84. }
  85. ],
  86. "requestType": "SIMULATOR"
  87. }
  88.  
  89. const {dialogflow, Image} = require('actions-on-google');
  90. const admin = require('firebase-admin');
  91. const functions = require('firebase-functions');
  92. const app = dialogflow();
  93.  
  94.  
  95. app.catch((conv, error) => {
  96. console.log("Error intent triggered.")
  97. console.error(error);
  98. conv.ask('Sorry, I ran into an error. Please try that again.');
  99. });
  100.  
  101. app.fallback((conv) => {
  102. console.log("Fallback intent triggered.")
  103. conv.ask("I didn't quite catch that. Could you say that again?");
  104. })
  105.  
  106. app.intent('Default Welcome Intent', (conv) => {
  107. console.log("Welcome intent triggered.")
  108. conv.ask("Welcome!!");
  109. });
  110.  
  111. exports.fulfillment = functions.region('europe-west1').https.onRequest(app);
  112.  
  113. "@google-cloud/common-grpc": "^0.9.0",
  114. "@google-cloud/firestore": "^0.17.0",
  115. "@google-cloud/functions-emulator": "^1.0.0-beta.5",
  116. "actions-on-google": "^2.4.1",
  117. "firebase-admin": "^6.0.0",
  118. "firebase-functions": "^2.0.5"
Add Comment
Please, Sign In to add comment