Possibility of connecting MySQL database to Google

2019-06-14 13:44发布

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条回答
祖国的老花朵
2楼-- · 2019-06-14 13:52

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.
查看更多
登录 后发表回答