Building Slack AI Assistants with Python & LangChain

  Рет қаралды 32,886

Dave Ebbelaar

Dave Ebbelaar

Күн бұрын

🚀 Kick-start your freelance career in data: www.datalumina.io/data-freela...
Here's a step-by-step guide to creating a Slack bot, installing it in a workspace, setting up Python code with LangChain and Flask, and using ngrok.
Interacting with AI agents via Slack provides a more natural way of communication and provides an integration with your team's workflow and allows for the integration of multiple bots for various tasks. This can improve efficiency and streamline communication, while also allowing the AI agents to become an integral part of your team.
🔗 Links
docs.datalumina.io/3y3XPD66nB...
github.com/daveebbelaar/langc...
⏱️ Timestamps
00:00 Introduction
00:44 What we will cover in this video
01:36 Why create a Slack bot?
04:05 Slack setup
07:07 Python setup
13:32 Server setup
17:23 Custom function setup
23:56 Why not just use ChatGPT?
25:54 What is Data Freelancer?
👋🏻 About Me
Hey there, my name is @daveebbelaar and I work as a freelance data scientist and coach. You've stumbled upon my KZbin channel, where I give away all my secrets when it comes to working with data. I'm not here to sell you any data course - everything you need is right here on KZbin. Making videos is my passion, and I've been doing it for 18 years. I just genuinely enjoy helping people.
While I don't sell any data courses, I do offer a coaching program for data professionals looking to start their own freelance business. If that sounds like you, head over to www.datalumina.io/ to learn more about working with me and kick-starting your freelance career.

Пікірлер: 88
@fathimetalsi5356
@fathimetalsi5356 Жыл бұрын
You're a legend. I started learning Python just two months ago and I really didn't know anything about coding. Today, I can't believe what I'm able to do, so thanks a lot. My next goal will be to create an assistant who can write code for me. I need to practice LangChain and Prompt Engineering.
@gkennedy_aiforsocialbenefit
@gkennedy_aiforsocialbenefit Жыл бұрын
You are a rock star, Dave! Great tutorial. Have watched several of your videos on Langchain and I just finished building the slack bot thanks to your excellent instruction and overview. Thank you.
@gkennedy_aiforsocialbenefit
@gkennedy_aiforsocialbenefit 11 ай бұрын
@DaveEbbelaar1... Yo Dave
@SuK55555
@SuK55555 10 ай бұрын
wow... great... good to hear that you were able to successfully build the slack bot. I am stuck at Step 2 (load_dotenv(find_dotenv())) which is returning FALSE when run in interative mode. Are you able to assist?
@ajithboralugoda8906
@ajithboralugoda8906 Жыл бұрын
Great Job Dave !! keep it up!
@ashishkgp
@ashishkgp 10 ай бұрын
Hats off! Very well explained!
@i.zhirnov
@i.zhirnov Жыл бұрын
haha nice new team member 😉, great guide, thank you, Dave. I know there are a lot of agents in LangChain supporting different documents, so it would be really exciting and helpful to handle them in one of the Slack channels.
@daveebbelaar
@daveebbelaar Жыл бұрын
Thanks Ivan! Definitely worth exploring for future videos 💭
@ricand5498
@ricand5498 Жыл бұрын
This channel is criminally underrated
@user-cb1pq4gh6d
@user-cb1pq4gh6d Жыл бұрын
your videos are great, really helping people man
@jzwadlo
@jzwadlo Жыл бұрын
this got my sub! Thanks Dave!
@kailai7255
@kailai7255 Жыл бұрын
thanks for sharing, it helps a lot, loving you!
@zeyuchen3821
@zeyuchen3821 Ай бұрын
This is so good. I love you Dave!
@shortthrow434
@shortthrow434 Жыл бұрын
Thank you Dave.
@TheRealKitWalker
@TheRealKitWalker Жыл бұрын
You're a rockstar dude 💪👏👏
@micbab-vg2mu
@micbab-vg2mu Жыл бұрын
Excellent video - With Langchain, you can surpass GPT limitations by incorporating tools and vector databases
@daveebbelaar
@daveebbelaar Жыл бұрын
Exactly!
@_slickyricky
@_slickyricky Жыл бұрын
Hey Dave when are you going to do part two of the video showing how to get Emma to do different tasks? A coding bot would be nice or further going into using a company’s db to feed back info when Emma is asked would also be great! Awesome video by the way thank you!
@EstherL-wd9yx
@EstherL-wd9yx Жыл бұрын
I second the connecting to the company's DB part, as long as no legal/security/privacy issue arises from this
@ai.millions
@ai.millions Жыл бұрын
Wow, that's a game changer
@SuK55555
@SuK55555 10 ай бұрын
Excellent Video Dave. I am stuck at Step 2, When I run (load_dotenv(find_dotenv())) this in interative mode in Visual Studio Code it is returning FALSE instead of TRUE. Any suggestions please
@84ed84
@84ed84 Жыл бұрын
Great video. Thanks for the walkthrough. Why did you use 3.5 turbo instead of GPT-4?
@daveebbelaar
@daveebbelaar Жыл бұрын
I am on the waitlist for GPT-4
@AngusLou
@AngusLou Жыл бұрын
This is brilliant. It would be nice to see how to structure multiple bots in different channels. Should we bulit multiple bots in one app or one bot per app?
@daveebbelaar
@daveebbelaar Жыл бұрын
Thanks! Depends on what you want. Both would work.
@marcova10
@marcova10 Жыл бұрын
Good one!, but suggest to not delegate delivering your videos by an AI, well,... not yet they are all well explained and very clear,
@yaser220
@yaser220 Жыл бұрын
Can I added it to group chat so she can analyze the chat then summarize it and if there’s tasks can it appoint the task to individual mentioned on the text 😅 I’m trying to do this but I’m not sure if it’s will work well
@krisszostak4849
@krisszostak4849 Жыл бұрын
Emma's comments are absolute gold! 😆
@daveebbelaar
@daveebbelaar Жыл бұрын
She's a bit sassy 😂
@krisszostak4849
@krisszostak4849 Жыл бұрын
@@daveebbelaar you should have hired a plain Jane instead 😉
@VastUni
@VastUni Жыл бұрын
perfect
@RVarblas
@RVarblas Жыл бұрын
Really cool video, thanks! Do you think something like this for Discord would be more difficult to achieve?
@daveebbelaar
@daveebbelaar Жыл бұрын
Thanks! I think the process should be very similar for Discord.
@paschalgodwin5808
@paschalgodwin5808 Жыл бұрын
@@daveebbelaar I tried doing somthing similar for discord some days ago before stumbling on your video, I was having issues getting to read the messages sent by the user. I came across an article that said something along the lines of discord changed their intents policy so as to keep messages more private and protected, except the bot is verified and permitted to do so, it will be hard to access users' message and feed the bot
@utkuarslan5
@utkuarslan5 Жыл бұрын
How would you connect the bot to Teams?
@damnft8218
@damnft8218 Жыл бұрын
Hello is there a way to contact you regarding one of these projects?
@AleSaira
@AleSaira Жыл бұрын
thx for the great explanation!! Can u give me a suggest how can I get my bot user id easier, because following ur instructions is not completely for me clear how can I run my script I mean it give me back some errors but in the end everything works good
@phenrotte130
@phenrotte130 Жыл бұрын
Same issue here, I use Pycharm to run the code
@bradcummins9532
@bradcummins9532 11 ай бұрын
Is personal data safe when you are linking the AI to your DB? D they own the rights to that data? Does anyone know how that works once the data is retrieved from your DB?
@SebastianGruber-ul1kc
@SebastianGruber-ul1kc Жыл бұрын
Dave it's a great tutorial! Just working on setting up a slack agent, unfortunately I am stuck at 15:30 as the slack API doesn't verify the URL. I get the error message "Your URL didn't respond with the value of the 'challange' parameter". Any thoughts what the issue could be? I am running the ngrok server and see requests coming in when checking localhost:4040. Any help would be highly appreciated. THx
@pinaster0477
@pinaster0477 Жыл бұрын
Did you sort this issue?
@ameeny5572
@ameeny5572 10 ай бұрын
@daveebbelaar bump
@yohanndiravino
@yohanndiravino 10 ай бұрын
@@pinaster0477 : kzbin.info/www/bejne/fHWvi2emmK6nodE
@MikeRhodesIdeas
@MikeRhodesIdeas 6 ай бұрын
bump! same error here
@just-another-gpt-user
@just-another-gpt-user Ай бұрын
Same here, it throws 401 Unauthorised in ngrok and flask, i tried regenerating signing secret but still same issue... this is a blocker ... @daveebbelaar quick response on this will be really helpful
@DJPapzin
@DJPapzin Жыл бұрын
I see the OpenAI API is used but where do we put the key? ".env" file?
@daveebbelaar
@daveebbelaar Жыл бұрын
Yes in the .env file
@ryankozak8968
@ryankozak8968 Жыл бұрын
Having issues with ngrok changing forwarding URL each session, leading to refreshes in slack api a must do, per session. Any work arounds to help keep this address static?
@daveebbelaar
@daveebbelaar Жыл бұрын
Unfortunately, that is not possible. It's kinda annoying but that is why this is a development setup.
@Gabirell
@Gabirell Жыл бұрын
Hi. Thanks for your videos… just a curiosity (off topic) where are you from? I’m curious about your “v’s”: for my ears sound like “f’s” which is common in my natural Valencia (Spain) and in Brazilian Portuguese… so… you seem to be north European so which is your most used language? Cheers!
@daveebbelaar
@daveebbelaar Жыл бұрын
Haha you are not the first one to mention that. I wasn't even aware of it. I am from the Netherlands ;)
@Gabirell
@Gabirell Жыл бұрын
@@daveebbelaar Really interesting how different languages have things in common… thanks for answering!
@galileor713
@galileor713 Жыл бұрын
Can we use it on whatsapp business?
@omnimode4804
@omnimode4804 4 ай бұрын
how to set up python interactive?
@DJPapzin
@DJPapzin Жыл бұрын
A free hosting server would be great
@user-zq3ij3qc9q
@user-zq3ij3qc9q Жыл бұрын
for the env your doc is missing the ai part. here is the code - OPENAI_API_KEY= "insertkeyhere"
@daveebbelaar
@daveebbelaar Жыл бұрын
Thanks! I've updated it ;)
@AICandyMD
@AICandyMD Жыл бұрын
when i try to run the interactive terminal to get the bot toke id, i keep getting this error and don't know how to fix it. ModuleNotFoundError: No module named 'slack_sdk' however when i run pip list, it shows that it's there. slack-sdk 3.21.3
@daveebbelaar
@daveebbelaar Жыл бұрын
Make sure that you are installing in the correct environment and also using the correct environment in VS Code. You can also try to run `pip3 install slack_sdk`
@MikeRhodesIdeas
@MikeRhodesIdeas 6 ай бұрын
@dave does this require a paid ngrok account to work?
@daveebbelaar
@daveebbelaar 6 ай бұрын
Nope, I used the free version.
@VenomsGT
@VenomsGT Жыл бұрын
comment for the algorithm :)
@daveebbelaar
@daveebbelaar Жыл бұрын
Thanks! 😁
@JohnMiller123
@JohnMiller123 11 ай бұрын
Can Emma be animated and use a resident text to speech app?
@farhanafridi8694
@farhanafridi8694 9 ай бұрын
Can we make a chatbot like this for WhatsApp ?
@ScottMillien
@ScottMillien Жыл бұрын
nice ! thank you :D I will sub your channel. I hope you can teach or show how I can connect it to a database , so it can read our company data !
@Zolipants
@Zolipants Жыл бұрын
I called mine Craig
@Patrick-rj8gh
@Patrick-rj8gh Жыл бұрын
If only Emma could wash the dishes and clean the bathroom.
@daveebbelaar
@daveebbelaar Жыл бұрын
5 years haha
@stratusgeret3794
@stratusgeret3794 11 ай бұрын
coming soon
@add_dm
@add_dm 10 ай бұрын
Lol
@makro3581
@makro3581 Жыл бұрын
Hey Dave, really good content, can't get enough :) Maybe someone can help with this error: urllib.error.URLError: What to do now?
@nicolascort
@nicolascort Жыл бұрын
Im getting the same error
@dawsongrattidge1695
@dawsongrattidge1695 Жыл бұрын
Me too
@jamesmccombe7289
@jamesmccombe7289 Жыл бұрын
​@@nicolascort Add this under the import os on line 1 import ssl ssl._create_default_https_context = ssl._create_unverified_context
@jamesmccombe7289
@jamesmccombe7289 Жыл бұрын
@@dawsongrattidge1695 Add this under the import os on line 1 import ssl ssl._create_default_https_context = ssl._create_unverified_context
@reginabm
@reginabm Ай бұрын
@@jamesmccombe7289 worked as a charm! Thanks!
@user-os8zn1nu8m
@user-os8zn1nu8m 2 ай бұрын
YO ANYBODY NOTICE PYTHON IS SPELLED AS PYTON IN THE DOC! BRO CORRECT IT
@daveebbelaar
@daveebbelaar 2 ай бұрын
sorry bro
@jimcrow2000
@jimcrow2000 Жыл бұрын
nice video, but would have been nice to know it is not beginner friendly, and some sort of python knowledge, would not have wasted time. thanks anyway.
@sergedecoster5388
@sergedecoster5388 Жыл бұрын
1. Extremely complicated solution for something really simple. But yes, i understand that more things can be done. 2.Implementing prompt templates in a vsto addon for outlook would be much more convenient. 3.If your email is in browser gramerlyGo already writes your email. 4. No talk about data privacy. Is it really ok to send the email you received to OpenAI? The sender did not agree to this. You might have NDA in place... 5. Making a local LLM write email would be quite slow. 6. No mention of the fact that copy paste into chatGPT is free, while using the API is expensive.
@iEuroPirate
@iEuroPirate Жыл бұрын
Man, email is not alone in big IT forest.
@joshualeeman1168
@joshualeeman1168 Жыл бұрын
LOL, are your replies to youtube comments generated by an AI assistant too?
@daveebbelaar
@daveebbelaar Жыл бұрын
Haha nope, that is still the real me - for now 👀
@daveebbelaar
@daveebbelaar Жыл бұрын
Stupid human with his incompetent brain was not even able to spell his own name correctly in Slack...
@DJPapzin
@DJPapzin Жыл бұрын
having difficulties obtaining my SLACK_BOT_USER_ID
@paresh3915
@paresh3915 Жыл бұрын
Having a hard time getting the bot_user_id using your method at 9:50 , can't seem to run the code in the interactive window as you did in the video , When I try to run the code: "import os from slack_sdk import WebClient from slack_sdk.errors import SlackApiError from slack_bolt.adapter.flask import SlackRequestHandler from slack_bolt import App from dotenv import find_dotenv, load_dotenv from flask import Flask, request from functions import draft_email # Load environment variables from .env file load_dotenv(find_dotenv())" I KEEP GETTING THIS ERROR : "False Output exceeds the size limit. Open the full output data in a text editor--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) c:\Users\15199\Desktop\AIExperiments\langchain-experiments\slack\app.py in line 8 6 from dotenv import find_dotenv, load_dotenv 7 from flask import Flask, request ----> 8 from functions import draft_email 9 # Load environment variables from .env file 11 load_dotenv(find_dotenv()) File c:\Users\15199\Desktop\AIExperiments\langchain-experiments\slack\functions.py:1 ----> 1 from langchain.chat_models import ChatOpenAI 2 from langchain.chains import LLMChain 3 from dotenv import find_dotenv, load_dotenv File c:\Users\15199\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\__init__.py:6 3 from importlib import metadata 4 from typing import Optional ----> 6 from langchain.agents import MRKLChain, ReActChain, SelfAskWithSearchChain 7 from langchain.cache import BaseCache 8 from langchain.callbacks import ( 9 set_default_callback_manager, 10 set_handler, 11 set_tracing_callback_manager, 12 ) ... ---> 26 def get(self, url: str, **kwargs: Any) -> requests.Response: 27 """GET the URL and return the text.""" 28 return requests.get(url, headers=self.headers, **kwargs) AttributeError: partially initialized module 'requests' has no attribute 'Response' (most likely due to a circular import)" and I cant seem to find a solution to get past that. Please suggest what I can do, I am new to learning Data science and Machine Learning using the jupyter interactive window, Please suggest what should I do to get past this step or any resources you can recommend to get more knowledge on this top. Appreciate your content a lot, Thank you!
How to Deploy AI Apps to the Cloud with Flask & Azure
31:15
Dave Ebbelaar
Рет қаралды 21 М.
How I'd Learn AI in 2024 (if I could start over)
17:55
Dave Ebbelaar
Рет қаралды 819 М.
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 128 МЛН
La revancha 😱
00:55
Juan De Dios Pantoja 2
Рет қаралды 68 МЛН
Китайка и Пчелка 4 серия😂😆
00:19
KITAYKA
Рет қаралды 3,8 МЛН
Python RAG Tutorial (with Local LLMs): AI For Your PDFs
21:33
pixegami
Рет қаралды 115 М.
Should You Still Learn To Code In 2024?
15:12
Tina Huang
Рет қаралды 79 М.
The LangChain Cookbook - Beginner Guide To 7 Essential Concepts
38:11
Greg Kamradt (Data Indy)
Рет қаралды 330 М.
Run your own AI (but private)
22:13
NetworkChuck
Рет қаралды 1,2 МЛН
Adding Agentic Layers to RAG
19:40
AI User Group
Рет қаралды 14 М.
AutoGPT Tutorial - More Exciting Than ChatGPT
23:56
Santrel Media
Рет қаралды 754 М.
Must Have AI Skills In 2024
12:27
Tina Huang
Рет қаралды 45 М.
How to Find Freelance Data & AI Projects in 2024
23:19
Dave Ebbelaar
Рет қаралды 8 М.
сюрприз
1:00
Capex0
Рет қаралды 1,5 МЛН
Как работает автопилот на Lixiang L9 Max
0:34
Семен Ефимов
Рет қаралды 17 М.
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 3,2 МЛН