Can I use Python to build an action for Google Home [closed]

流过昼夜 提交于 2021-02-18 12:52:12

问题


I am starting development of Google Home actions and would like to do so with the Python language instead of node js, provided in the getting started tutorial at https://developers.google.com/actions/get-started/.

I was going through the tutorial and was stuck at the point where it requires the use of node js for the demo facts app.

I need to use Python for this, as mentioned above. (I think web hooks are something of importance here. Not sure what they are.)


回答1:


The webhook is the callback that is called by the action. It will receive a JSON payload with all of the context data from Google Assistant. Google will send a POST request to whatever service you specify in the API.AI console as the webhook. It is then up to you to send a response back to Google so that it can 'render' that response on the client device. You can use flask or any other Python framework to process the POST request and generate your response.

Remember that Google Assistant can run on a variety of platforms and as such, you will want to look at the 'surface' parameter to specialize your response payload for the device you are responding to.




回答2:


Yes, you can use python for developing google home .I have used AWS Lambda and api gateway to map the web hook. If your code is too small you can code in the lambda inline editor itself but if it include additional import packages ,code it in your machine and zip it along with necessary packages .The steps are for notifications



来源:https://stackoverflow.com/questions/45976720/can-i-use-python-to-build-an-action-for-google-home

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!