使用MySQL的对话流聊天机器人

使用MySQL的对话流聊天机器人

问题描述:

我正在使用Dialog-flow开发一个聊天机器人,它将基于我更喜欢​​使用MySQL的数据库。聊天机器人在查询数据后将根据数据库发送答案。

I am developing a Chat bot using Dialog-flow which will be based on a database that I am preferring to use MySQL. The Chat bot will send the answers on the basis of DB after querying the data.

我创建了一个带有小型数据库的基本聊天机器人。

I have created a basic chat bot with a small Database.

我应该怎么做才能在MySQL和Dialog-flow之间建立通信链接,或者我可以使用任何数据库?请帮助我。

What should I do to develop a communication link between MySQL and the Dialog-flow or is there any Database that I can use? Help me, please.

要通过Dialogflow代理与数据库进行通信,您将需要使用实现

To communicate with your database from a Dialogflow agent, you will need to use fulfillment.

Dialogflow的 Node.js的实现库,您可以用来开始构建实现代码。您可以看到 Dialogflow GitHub 中的许多实现代码示例。

Dialogflow has a fulfillment library for Node.js that you can use to start building your fulfillment code. You can see the Dialogflow GitHub for many samples of fulfillment code.

如果您使用Node.js来构建自己的实现,则可以通过Node.js MySQL客户端(例如 mysqljs / mysql

If you are using Node.js to build your fulfillment, you can integrate it with MySQL via a Node.js MySQL client such as mysqljs/mysql.