Possibility of connecting MySQL database to Google Assistant

£可爱£侵袭症+ 提交于 2019-12-08 04:16:13

问题


What I want to implement is at least a working prototype of a Google Assistant Action with the use of local MySQL database. What I've taught of is MySQL DB-> Google Cloud Platform-> DialogFlow -> Google Assistant.

So the end product would be for example, I say: "What is my total sales" and Google Assistant would retrieve the data from MySQL. I've been trying to look for solutions online and none seem to match what I am looking for. Would this solution be theoretically possible? and how would I be able to integrate the cloud platform into the Google Assistant Action through DialogFlow? Thanks!


回答1:


It is possible!

  1. Create a Dialogflow agent. Define your intents and add the static response. Test it.
  2. Once tests are passed, integrated it with Actions-On-Google using "Integration tab" to the left.
  3. Test the Assistant with static responses.
  4. When Assistant is ready with the static response, develop a webhook. You can use different client libraries in NodeJS (AoG Client or Dialogflow Client) or in Python (Flask-Assistant or Dialogflow Client) or can create your own.
  5. Once the webhook is ready, run it locally and expose to the internet using NGROK.
  6. Use the generated URL as fulfillment to the Dialogflow agent and update the assistant's draft version.
  7. Create a MySQL DB and connect it webhook using regular NodeJS or Python code
  8. Restart the server and test end to end!
  9. Once tested locally with NGROK, you can PUSH it to the cloud (NodeJS or Python) or any other server.


来源:https://stackoverflow.com/questions/51471128/possibility-of-connecting-mysql-database-to-google-assistant

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