How to build a chatGPT chatbot on Slack

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 มิ.ย. 2024
  • Welcome to this tutorial video on creating a Slack chatbot using the OpenAI language model, LangChain, and the Slack Bolt library. This video will showcase the creation of an AI-powered Slackbot that can engage in natural conversations, answer questions, and provide information on various topics.
    In the first part of this video, we will demonstrate the Slackbot in action and show how it can be used in real-life scenarios.
    Next, we'll provide step-by-step instructions on how to set up your Slackbot, including setting up a Slack account, creating a Slackbot, and obtaining the necessary tokens. We'll also review the setup process for OpenAI and how to get started with the LangChain library.
    We'll then dive into the development process, introducing the LangChain library and providing an overview of how it works. This includes the GPT Clone function, which allows us to create a chatbot using the OpenAI language model.
    In the code section, we'll go over the Slackbot code in detail and explain each part. You'll learn how to implement the LangChain library, process messages from Slack, and generate responses using the OpenAI language model.
    Finally, we'll test the Slackbot and see it in action. We'll ask it a series of questions and see how it responds.
    By the end of this video, you'll have a working Slackbot that can engage in natural conversations and provide valuable information on a wide range of topics.
    Looking to learn more? Check out my full course on Building Slack ChatGPT applications
    How to Build Slack ChatGPT Apps - Real World Examples - www.udemy.com/course/master-l...
    Resources:
    Slack Bolt library: github.com/slackapi/bolt-js
    OpenAI: openai.com/
    LangChain: langchain.readthedocs.io/en/l...
    Github Repo: github.com/hollaugo/chatgpt-s...
    Chapters:
    00:00 Introduction
    00:27 Showcase
    02:30 Setup Instructions
    03:03 Slack Setup
    06:28 OpenAI Setup
    06:42 Dev Setup
    07:58 LangChain Overview
    11:29 LangChain GPT Clone Function
    16:15 Code
    19:10 Final Test
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 61

  • @kevon217
    @kevon217 ปีที่แล้ว +1

    Thanks so much for this demo! Great teaching.

  • @DennisDomingo
    @DennisDomingo 2 หลายเดือนก่อน +1

    great job Ugo! very helpful!

    • @promptcircleai
      @promptcircleai  2 หลายเดือนก่อน

      Thanks a lot Dennis!

  • @miriamramstudio3982
    @miriamramstudio3982 9 หลายเดือนก่อน

    Great video. Thanks

  • @pedrominicz
    @pedrominicz 2 หลายเดือนก่อน +1

    Good video. I like that you showed the Slack bot setup. I think you spent too much time in the LangChain overview. The ChatGPT temperature parameter is not about whether or not the AI outputs factual information, but about how much randomness it will add to the output. With zero temperature, it will always give the same reply to the same prompt, but that reply may still be factually incorrect. I like that you showcased a full project in this video.

    • @promptcircleai
      @promptcircleai  2 หลายเดือนก่อน +1

      Thank you for your feedback. I appreciate!

  • @adamwood1350
    @adamwood1350 ปีที่แล้ว +1

    Are you able to train the chatbot within a specific Slack channel? For instance, if I want it to respond based on certain program features or processes specific to that channel only?

    • @promptcircleai
      @promptcircleai  ปีที่แล้ว +1

      Absolutely! Slack provides APIs to manage channels so ideally, you could use conditional branching logic to make the bot respond in a specified manner for each channel depending on the requirements

  • @user-td6ju7zn6h
    @user-td6ju7zn6h ปีที่แล้ว +3

    Great tutorial. Very detailed. Thanks. Can you please specific instructions on how to connect the dots between the Python code and Slack? I notice you build it up to a virtual environment and then jump to Python code. It would be great if you can provide on how to connect the two, so that I can test it for myself. Thanks.

  • @user-kc6sx8he3t
    @user-kc6sx8he3t 6 หลายเดือนก่อน

    the part where slack connects to the venv - please advise ... thank you for the tutorial

  • @archiehollingsworth3179
    @archiehollingsworth3179 ปีที่แล้ว +2

    Hello! thank you so much for this, is it possible to use your own database of information to feed the slack bot and also your information in slack for it to write it's responses based on this?

    • @promptcircleai
      @promptcircleai  ปีที่แล้ว +1

      Absolutely you can. So you can link a database to GPT using various techniques. One of the methods is by embedding the data into a vector database and then using that do find similarities. I'll be making a video on that. Here is an example of that GPT Powered Notion Bot - A transformational solution for Internal knowledge problems
      th-cam.com/video/oGqWWVRLfow/w-d-xo.html. Here I am using Notion as the database

    • @jonathongeorge238
      @jonathongeorge238 ปีที่แล้ว

      @@promptcircleai Please let us know when this is made! That would be very helpful

    • @hartnady
      @hartnady ปีที่แล้ว +2

      Yes. I used a MySQL server to store queries and responses as a messaging queue to work around Slacks 3 second time out restriction. My GPT Slack chat bot is hosted as Python Flask app on PythonAnywhere using a DIY messaging queue. Works very well.

  • @hozefakapasi6706
    @hozefakapasi6706 10 หลายเดือนก่อน

    Nice demo !
    Can you please suggest the operating system for the terminal for run the python code and also the advised python version ?
    I tried with centos 7.9 but was having python3.6.8 limitation.

    • @promptcircleai
      @promptcircleai  10 หลายเดือนก่อน

      In the video I was using a Mac OS. I expect the commands to be similar in CentOS. I’d recommend using Python3.9 and above if possible.

  • @jayrn4596
    @jayrn4596 3 หลายเดือนก่อน +1

    This is awesome. Can you please tell me what if I want to use my own dataset in the code as a csv file and prompt should do Question Answering based on the provided dataset. Could you please help me with that?

    • @promptcircleai
      @promptcircleai  หลายเดือนก่อน

      Sorry for the late response. Happy to discuss how.

  • @stuartgibson9749
    @stuartgibson9749 ปีที่แล้ว +1

    is there a way to get it to work in other Slack Channels and not just the messaging window, great tutorial.

    • @promptcircleai
      @promptcircleai  ปีที่แล้ว +1

      Yes absolutely, you just need to add it to a channel and then write an event listener that listens for app mentions. That way, when you at mention it, it will respond to you.

  • @michaelm2387
    @michaelm2387 ปีที่แล้ว

    Hi! thanks a lot for this video! Love it and I like the prompt! I'm struggling to be able to do the same (without LangChain) in my rails application. Just trying to listen to a message, get the message, and be able to run ChatGPT openAI to generate the response. I can't manage to be able to listen to incoming messages from Slack. Any idea? Direction? Thanks again :)

    • @alokkumarsingh8556
      @alokkumarsingh8556 ปีที่แล้ว

      Read about socket mode. It starts a webscoket connection with slack API and any changes are pushed here.

    • @alokkumarsingh8556
      @alokkumarsingh8556 ปีที่แล้ว

      You just start it and use ur bot

    • @alokkumarsingh8556
      @alokkumarsingh8556 ปีที่แล้ว

      It conencts using SLACK APP TOKEN and BOT token to API

  • @rhandelpaulics6804
    @rhandelpaulics6804 ปีที่แล้ว +1

    Hello, nice tutorial can you help me ?
    I follow all the process in the video but when I send message to slack don't return nothing.
    Do you know what I can do?
    I'm using your github Repo.

    • @promptcircleai
      @promptcircleai  ปีที่แล้ว

      Thanks for reaching out. What error exactly are you getting?

    • @rhandelpaulics6804
      @rhandelpaulics6804 ปีที่แล้ว +1

      @@promptcircleai Hello, I am not getting any errors or any output during code execution.
      I would like to use ChatGPT within a channel where I can have continuous interaction. I have tried various methods but without success, and from what I saw in the video, yours is doing that. If you could help me, I would be very grateful. I apologize for the delay in responding to you

    • @promptcircleai
      @promptcircleai  ปีที่แล้ว

      @@rhandelpaulics6804, I'd love to. You can join our discord so that we can do a screen share there. discord.gg/24ZCVA3n

    • @boomerangtesting7304
      @boomerangtesting7304 ปีที่แล้ว

      @@promptcircleai Hi! same issue at my end, no errors but no result either. Can you help out?

  • @user-zd8oe3ed1g
    @user-zd8oe3ed1g ปีที่แล้ว

    Bro I am trying to create a slack app that sends notifications of files shared automatically in my app itself if someone shares me a file to my account. I am facing some issues. It will be awesome if you could help me with it.

    • @promptcircleai
      @promptcircleai  ปีที่แล้ว

      Thanks for reaching out. How are you handling the file created event? api.slack.com/events/file_created

    • @user-zd8oe3ed1g
      @user-zd8oe3ed1g ปีที่แล้ว

      @@promptcircleai Bro here I am using a online cloud storage platform and they have some public api to check if someone has shared me a file I want those notifications to be pushed to me on slack. I want to create an app that does this task in its own channel just like gdrive app. It will be awesome if you can help me with it.

  • @linkeur_ssb9176
    @linkeur_ssb9176 ปีที่แล้ว +2

    The bot is only active when I run the script, how to activate permanently the bot ?
    Thanks for the tutorial !

    • @promptcircleai
      @promptcircleai  ปีที่แล้ว +1

      So you would have to host the app on a cloud hosting service. I suggest hosting on GCP Cloud functions. I will look into making a video on that soon

    • @boomerangtesting7304
      @boomerangtesting7304 ปีที่แล้ว

      Can you help me get the bot working, I get no error and no reply.

    • @promptcircleai
      @promptcircleai  ปีที่แล้ว +1

      @@boomerangtesting7304 join the discord here discord.gg/BzZ3tCu5 so that you can share screenshots of what may be wrong.

    • @boomerangtesting7304
      @boomerangtesting7304 ปีที่แล้ว

      @@promptcircleai IT WORKED!!! THANK YOU. My open ai api had exceeded the limit I had to pay up 😭 but still interested to know, if you are paying for the api or if there's a work around

  • @thejasvin
    @thejasvin 11 หลายเดือนก่อน

    we are getting SSL : certificate _Verify_Failed error. how to overcome this? any bandwidth issue with lang chain APIs ? or is this my firewall blocking ?

    • @ManishSharma-wb7yx
      @ManishSharma-wb7yx 10 หลายเดือนก่อน

      @promptircle I am getting the same error

    • @thejasvin
      @thejasvin 10 หลายเดือนก่อน

      @@ManishSharma-wb7yx we were able to overcome this issue. As we found out it was our company firewall that was blocking even after using proxy IP ... So when we tried whole setup in our personal laptop everything worked fine.
      Also note open AI api keys may get expired or over used. So you may have to keep generating new keys every two to three days based on your testing needs.

  • @muneebchaudhry-xv8pi
    @muneebchaudhry-xv8pi ปีที่แล้ว +1

    Where does the OpenAI token go?

    • @promptcircleai
      @promptcircleai  ปีที่แล้ว +1

      It should be exported as an environment variable which will be used in your project

    • @tkaracan
      @tkaracan ปีที่แล้ว

      @@promptcircleai can you please explain this part? i could not find where to use that token

    • @tkaracan
      @tkaracan ปีที่แล้ว

      also its not "ConversationalBufferWindowMemory" anymore, seems like they changed it to "ConversationBufferWindowMemory"

    • @tkaracan
      @tkaracan ปีที่แล้ว

      lol i asked chatGPT and it solved the problem:
      When the creator of the tutorial said "It should be exported as an environment variable which will be used in your project," they meant that the ChatGPT token should be stored as an environment variable on your computer, which your project can then access.
      To export an environment variable, you would need to do the following:
      Obtain your ChatGPT token from the OpenAI website.
      Open your terminal or command prompt.
      Type the following command:
      export CHATGPT_TOKEN=
      Replace with the actual token you obtained from the OpenAI website.
      Press Enter.
      After you have done this, your ChatGPT token will be stored as an environment variable on your computer. Your project should be able to access this variable when it needs to use the token.

    • @promptcircleai
      @promptcircleai  ปีที่แล้ว

      There are two ways. One is to store them in .env variables or simply using the terminal to export the token. The command should look like this export OPENAI_API_KEY=