Dopo settimane di tentativi, sono finalmente riuscito a configurare un bot AI, simile a discobot, ma che impara ed è più reattivo. Ecco come ho fatto, per chiunque fosse interessato a impostarlo. Ci sono diverse fasi, ma una volta completata la configurazione, il risultato è straordinario.
Installa il plugin hubot per Discourse Hubot Adapter for Discourse. Per installare hubot sul tuo Discourse, le variabili di hubot come HUBOT_DISCOURSE_USERNAME vanno inserite nel file (cartellahubot)/bin/hubot: basta usare nano o un editor di testo per scrivere export HUBOT_DISCOURSE_USERNAME=mio_bot. Per ulteriori dettagli, consulta questa pagina Discobot for training - #10 by featheredtoast
export HUBOT_DISCOURSE_USERNAME=(nome_utente_del_bot, non usare discobot)
export HUBOT_DISCOURSE_KEY=(chiave_api_del_tuo_utente_bot, non la chiave API del sito)
export HUBOT_DISCOURSE_SERVER=(url_di_discourse)
export API_AI_CLIENT_ACCESS_TOKEN=(token_api_del_server_bot_di_dialogflow, reperibile nelle impostazioni)
export GOOGLE_APPLICATION_CREDENTIALS=(tuo_file).json
export DIALOGFLOW_PROJECT_ID=(nome_del_progetto)
Ora avvia il tuo hubot digitando bin/hubot -a discourse-adapter per eseguirlo. Se desideri che rimanga in esecuzione anche quando non sei nel terminale, digita nohup bin/hubot -a discourse-adapter &.
Invia un messaggio privato al bot per testarlo. Se hai configurato il bot Dialogflow con conversazioni informali (small talk), puoi salutare, chiedere “come stai” e iniziare subito una chiacchierata. Per altri dialoghi, dovrai impostarli manualmente. Su YouTube ci sono alcuni tutorial utili per iniziare: https://youtu.be/HqfN9qjNj9A
Inoltre, un sincero ringraziamento a @codinghorror e al team per aver sviluppato Discourse, e a @awole20 per aver creato il plugin hubot; non ce l’avrei fatta senza di voi!
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.
Prima di addentrarmi nell’implementazione sul mio Discourse (e dato che sono solo abbastanza competente, ma bravo a seguire le istruzioni ) … queste istruzioni in questo thread funzionano ancora? O… c’è un modo più attuale o preferito per integrare un bot AI?