This guide is based on ParlAI's chat service tutorial, where we provide the base configuration and classes for deploying our example ChattyGooseAgent
as a Facebook Messenger chatbot. The following steps deploy the webhook server to Heroku, however it is also possible to deploy it locally by setting the local: True
parameter under opt
in config.yml
.
-
Create a new Facebook Page and Facebook App for Messenger to host the Chatty Goose agent. Add your Facebook Page under the Webhooks settings for Messenger, and check the "messages" subscription field.
-
If deploying to Heroku, create a free account and log into the Heroku CLI on your machine.
-
Run the webhook server and Chatty Goose agent using our provided configuration. This assumes you have the ParlAI Python package installed and are inside the
chatty-goose
root repository folder.
python -m parlai.chat_service.services.messenger.run --config-path examples/messenger/config.yml
-
Add the webhook URL outputted from the above command as a callback URL for the Messenger App settings, and set the verify token to
Messenger4ParlAI
. For Heroku, this URL should look likehttps://firstname-parlai-messenger-chatbot.herokuapp.com/webhook
. -
Visiting your page and sending a message should now trigger the agent to respond!