إعداد روبوت دردشة ذكي على discourse 🤖

مرحباً،

بعد أسابيع من التجريب، تمكنت أخيراً من إعداد روبوت ذكاء اصطناعي، يشبه discobot لكنه قادر على التعلم وأكثر استجابة. إليك كيف قمت بذلك لأي شخص مهتم بإعداده. هناك عدد من الخطوات، لكن بمجرد إكمال الإعداد، تكون النتيجة مذهلة.

  1. قم بتثبيت إضافة hubot لمنصة discourse من الرابط: Hubot Adapter for Discourse. لتثبيت hubot على discourse، يجب إدخال متغيرات hubot مثل HUBOT_DISCOURSE_USERNAME في ملف (yourhubotfolder)/bin/hubot. يمكنك ببساطة استخدام nano أو محرر نصوص آخر لتعديل الملف وإضافة السطر: export HUBOT_DISCOURSE_USERNAME=mybot. لمزيد من التفاصيل، انتقل إلى: Discobot for training - #10 by featheredtoast

  2. سجّل حساباً جديداً وأنشئ روبوتاً جديداً على: https://dialogflow.com/

  3. قم بتثبيت مُكيّف hubot / apiai (Dialogflow) من هنا: GitHub - ojacques/hubot-apiai: Add smartness and conversational UX to Hubot with API.AI as back-end · GitHub
    3أ. تأكد من ضبط المتغيرات التالية في ملف bin/hubot:

    export HUBOT_DISCOURSE_USERNAME=(اسم مستخدم الروبوت، لا تستخدم discobot)
    export HUBOT_DISCOURSE_KEY=(مفتاح API الخاص بمستخدم الروبوت، وليس مفتاح موقع discourse)
    export HUBOT_DISCOURSE_SERVER=(رابط موقع discourse)
    export API_AI_CLIENT_ACCESS_TOKEN=(مفتاح API الخاص بخادم الروبوت في Dialogflow، موجود في الإعدادات)
    export GOOGLE_APPLICATION_CREDENTIALS=(yourjson).json
    export DIALOGFLOW_PROJECT_ID=(اسم المشروع)

    ستحتاج إلى تنزيل ملف JSON لمفاتيح اعتماد Google، ويمكنك الحصول عليه باتباع هذا الدليل: https://cloud.google.com/genomics/downloading-credentials-for-api-access

  4. الآن، شغّل hubot بكتابة الأمر bin/hubot -a discourse-adapter. إذا أردت تشغيله حتى عندما لا تكون في الطرفية، اكتب nohup bin/hubot -a discourse-adapter &.

  5. أرسل رسالة خاصة للروبوت للاختبار. إذا قمت بإعداد روبوت Dialogflow مع ميزة المحادثات الصغيرة، يمكنك قول “مرحباً”، “كيف حالك”، والبدء في محادثات عادية فوراً. أما المحادثات الأخرى فيجب إعدادها يدوياً. توجد بعض الدروس على يوتيوب تمثل نقطة انطلاق جيدة: https://youtu.be/HqfN9qjNj9A

إليك عرض توضيحي:

إذا كانت لديك أي أسئلة، فلا تتردد في طرحها.

أيضاً، شكرًا جزيلاً لـ @codinghorror والفريق على تطوير discourse، ولـ @awole20 على تطوير إضافة hubot، لم يكن ليتمكن من ذلك بدونكم!

38 إعجابًا

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)

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

5 إعجابات

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

إعجاب واحد (1)

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

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

3 إعجابات

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

إعجاب واحد (1)

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)

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 إعجابات

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 إعجابات

Thanks, great post! Love it

إعجابَين (2)

واو، أعجبتني هذه الفكرة ويجب أن أفكر فيها في هذه الأيام. أحتاج إلى بعض الذكاء الاصطناعي في موقعي على discourse.

3 إعجابات

قبل أن أتعمق في تطبيق هذا على Discourse الخاص بي (وبما أنني لست بارعًا إلا قليلاً، ولكني جيد في اتباع التعليمات :nerd_face: ) … هل هذه التعليمات في هذا الموضوع لا تزال تعمل؟ أو… هل هناك طريقة أحدث أو مفضلة لدمج روبوت ذكاء اصطناعي؟

3 إعجابات

كانت هناك بعض المحادثات. إليك واحدة تتضمن تطورات أحدث:

إعجابَين (2)