2
votes

I've been building an alexa apps of alexa using skills kit sdk, python and aws Lambda Functions but I'm new to developing google home apps. There are many sample projects on github but they all are on node.js. I'm a python developer so I need to build google home app using python and google cloud functions. Just like in Alexa, where there is a Developer portal and intent there matches the intent written on console portal using aws Lambda functions and we mapped both portals using Skill ID and arn #. Just like, alexa's color skill kit using sdk sample (below link)

https://github.com/alexa/skill-sample-python-colorpicker/blob/master/lambda/py/lambda_function.py

Is there any sample code for it or anything one can help me with. It'll be highly appreciated.

1

1 Answers

1
votes

There is currently no official Python library for Actions on Google. You may find unofficial ones.

You alternatively can just return JSON directly instead of using a library to wrap the JSON in easier to read methods.

For example, a simple response in Node.js:

conv.ask(new SimpleResponse({
  speech: 'Howdy, this is GeekNum. I can tell you fun facts about almost any number, my favorite is 42. What number do you have in mind?',
  text: 'Howdy! I can tell you fun facts about almost any number. What do you have in mind?',
}));

is equivalent to the following Dialogflow webhook JSON:

{
 "payload": {
   "google": {
     "expectUserResponse": true,
     "richResponse": {
     "items": [
       {
         "simpleResponse": {
           "textToSpeech": "Howdy! I can tell you fun facts about almost any number, like 42. What do you have in mind?",
           "displayText": "Howdy! I can tell you fun facts about almost any number, like 42. What do you have in mind?"
          }
       }
     ]
   }
  }
 }
}