Einrichten eines intelligenten Chatbots auf Discourse :Roboter:

Hallo,

Nach wochenlangem Experimentieren habe ich es endlich geschafft, einen KI-Bot einzurichten, der Discobot ähnelt, aber lernt und reaktionsschneller ist. Hier ist, wie ich es gemacht habe, falls Sie interessiert sind, ihn einzurichten. Es gibt einige Schritte, aber sobald alles eingerichtet ist, ist das Ergebnis beeindruckend.

  1. Installieren Sie das Hubot-Plugin für Discourse unter Hubot Adapter for Discourse. Um Hubot auf Ihrem Discourse-Server zu installieren, werden die Hubot-Variablen wie HUBOT_DISCOURSE_USERNAME in die Datei (IhrerHubotOrdner)/bin/hubot eingegeben. Öffnen Sie diese einfach mit nano oder einem anderen Editor und fügen Sie folgendes hinzu: export HUBOT_DISCOURSE_USERNAME=mybot. Weitere Details finden Sie hier: Discobot for training - #10 by featheredtoast

  2. Registrieren Sie sich und erstellen Sie einen neuen Bot unter https://dialogflow.com/.

  3. Installieren Sie einen Hubot-/ApiAI-(Dialogflow)-Adapter von hier: GitHub - ojacques/hubot-apiai: Add smartness and conversational UX to Hubot with API.AI as back-end · GitHub
    3a. Stellen Sie in der Datei bin/hubot sicher, dass die folgenden Variablen gesetzt sind:

    export HUBOT_DISCOURSE_USERNAME=(Benutzername des Bots, nicht discobot verwenden)
    export HUBOT_DISCOURSE_KEY=(API-Schlüssel Ihres Bot-Benutzers, nicht der Site-API-Schlüssel)
    export HUBOT_DISCOURSE_SERVER=(Discourse-URL)
    export API_AI_CLIENT_ACCESS_TOKEN=(Dialogflow-Bot-Server-API, in den Einstellungen zu finden)
    export GOOGLE_APPLICATION_CREDENTIALS=(IhrJson).json
    export DIALOGFLOW_PROJECT_ID=(NameDesProjekts)

Sie müssen eine Google-Anwendungszugangsdaten-JSON-Datei herunterladen, die Sie gemäß dieser Anleitung erhalten können: https://cloud.google.com/genomics/downloading-credentials-for-api-access

  1. Starten Sie Ihren Hubot jetzt, indem Sie bin/hubot -a discourse-adapter eingeben, um ihn auszuführen. Wenn Sie möchten, dass er auch läuft, wenn Sie nicht im Terminal sind, geben Sie nohup bin/hubot -a discourse-adapter & ein.

  2. Senden Sie dem Bot eine private Nachricht zum Testen. Wenn Sie den Dialogflow-Bot mit Small Talk eingerichtet haben, können Sie sofort „Hallo", „Wie geht es dir?" sagen und Small Talk führen. Für andere Dialoge müssen Sie diese selbst einrichten. Es gibt einige Tutorials auf YouTube, die einen guten Start bieten: https://youtu.be/HqfN9qjNj9A

Hier ist eine Demo:

Wenn Sie Fragen haben, zögern Sie nicht, diese zu stellen.

Außerdem ein großes Dankeschön an @codinghorror und das Team für die Entwicklung von Discourse sowie an @awole20 für die Entwicklung des Hubot-Plugins. Ohne euch wäre es nicht möglich gewesen!

38 „Gefällt mir“

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!

1 „Gefällt mir“

Hubot is indeed able to be installed on Heroku - check out the Hubot docs for more info: Deploying to Heroku | HUBOT

5 „Gefällt mir“

That’s cool. I’ll look further into this.

1 „Gefällt mir“

@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)?

1 „Gefällt mir“

You need to be the admin of not only discourse but of the server it sits on. No way around that one.

3 „Gefällt mir“

That´s a bummer. Thanks for the information though.

1 „Gefällt mir“

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.

1 „Gefällt mir“

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?

4 „Gefällt mir“

Hello Nacho,

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.

5 „Gefällt mir“

Danke, toller Beitrag! Ich liebe es!

2 „Gefällt mir“

Wow, das hat mir sehr gut gefallen! Ich muss das in den nächsten Tagen noch einmal überdenken.
Ich brauche etwas KI auf meiner Discourse-Seite.

3 „Gefällt mir“

Bevor ich dies auf meinem Discourse implementiere (und da ich nur einigermaßen gut darin bin, Anweisungen zu befolgen :nerd_face: ), funktionieren diese Anweisungen in diesem Thread noch? Oder… gibt es eine aktuellere oder bevorzugte Methode, einen KI-Bot zu integrieren?

3 „Gefällt mir“

Es gab ein paar Gespräche. Hier ist eines mit neueren Entwicklungen:

2 „Gefällt mir“