After weeks of tinkering, I finally managed to set up an AI bot, similar to discobot but one that learns and is more responsive. Here is how I did it for anyone interested in setting it up. There is quite a few steps, but once you get it all set up, the result is amazing.
Install the hubot plugin for discourse Hubot Adapter for Discourse, to install hubot on your discourse, the hubot variables like HUBOT_DISCOURSE_USERNAME are entered into (yourhubotfolder)/bin/hubot file, just nano or edit it to write export HUBOT_DISCOURSE_USERNAME=mybot) For more details go here Discobot for training - #10 by featheredtoast
export HUBOT_DISCOURSE_USERNAME=(bot’s username, don’t do discobot)
export HUBOT_DISCOURSE_KEY=(your bot-user’s api key, not the site api)
export HUBOT_DISCOURSE_SERVER=(discourse url)
export API_AI_CLIENT_ACCESS_TOKEN=(dialogflow bot server api, found in the settings)
export GOOGLE_APPLICATION_CREDENTIALS=(yourjson).json
export DIALOGFLOW_PROJECT_ID=(nameoftheproject)
Now boot up your hubot by typing bin/hubot -a discourse-adapter to run it. If you want it to run even when you are not in the terminal, type nohup bin/hubot -a discourse-adapter &
Private message the bot for testing. If you set up the dialogflow bot with small talk, you can say hi, how are you and engage in small talk right away. Other dialogue you have to set up. There are a few tutorials on youtube that are a good start. https://youtu.be/HqfN9qjNj9A
Also, a proper thank you to @codinghorror and the team for developing discourse, and @awole20 for developing the hubot plugin, couldn’t have done it without you!
This is just plain awesome! I am not too experienced with this myself, but do you know if this would work to deploy on Heroku or not? Thanks for the tutorial!
@awole20@Timothy_Vail I know I sound absolutely hilarious by saying this, but is there any way to make a bot that you guys know of without being an admin (a.k.a having an api key)?
I am slowly working my way through this. What threw me at the first stage was access errors when running yo hubot --adapter=discourse-adapter per the installation instructions for the plugin. It looks like you have to change the permission for the folders. Fix is documented here.
So, as I discussed above, I hit an error installing NPM. Error was using root when installing, a common gotcha that leads to a lot of EACCES and permission errors. This is a well-documented error. I believe a lot of people are on Digital Ocean. Follow their documentation for correctly setting up NPM on your droplet.
Thanks for sharing this, Tim. I’m curious to know what types of dialogue you’ve set up for the chatbot. How are your forum users engaging with it in the real world?
It’s actually been awhile since I’ve used the chatbot, but am planning on using it again for an upcoming project. Mostly it was used for training sessions for teachers, they would go through a course using chatbot and learn about teaching through the dialogue. Let me know if you have any questions.
Before I dive into implementing this on my Discourse (and since I am only somewhat proficient, but good at following directions ) … are these instructions in this thread still working? Or… is there a more current or preferred way to integrate an AI bot?