How does Facebook Messenger connect with Wit.ai Bot Engine?

后端 未结 3 1306
谎友^
谎友^ 2021-02-03 13:37

In Facebook\'s documentation they refer to wit.ai Bot Engine, but I can\'t find anywhere online where its explained how to connect the Story that you build in Wit with your Face

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-03 14:02

    I reviewed the latest updates on wit.ai. It seems that Wit.ai does not have an in-built integration with Facebook Messenger. That is, you can't plug it into Facebook Messenger directly by using the page access tokens etc.

    What you'll need to do instead is set up a webhook where Messenger will send callbacks with the details of the user's message. If you want you can enable Facebook's in-built NLP too.

    Then inside your webhook, send a call to Wit.ai, and get its output in JSON. Then you must process the JSON and send a reply back to the customer using a Sendmessage API call.

    It's a bit long-winded, but if you have this setup, you can potentially use any AI engine in the backend. Including wit.ai or dialogflow.

提交回复
热议问题