Connect OpenAI To +5,000 Tools (LangChain + Zapier)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial we are going to learn how to connect Lang chain and make it send slack messages yes you can send it to slack and you can send it to about 5 000 other apps too because in this tutorial we are going to learn how to connect Lane chain to zapier let's take a look at what this means here now you'll have likely seen this from another video where we explain what Lang chain is and in this case it is kind of the bridge between openai your other language models and some of your other apps traditionally to load documents however what happens when you connect it to zapier well you're going to get some really cool things zapier can connect to over 5 000 different applications so all of a sudden you're about to have the intelligence of open AI you're going to connect it via Lang chain and with zapier you're going to connect to virtually every single app that you're using in the workplace and once you do this you're not going to just need one smiley face not two but you're going to need about eight different smiley faces for how good you're going to feel when this comes out here now why can this happen right now it's because zapier is releasing natural language actions and this is a fancy way of saying that zapier is going to get really good at taking natural language as an input and doing their zapier magic to invoke actions out there with your third-party tools now the complicated part with this the really interesting part is how you take a natural language and then match it up to the correct API call that you need for your third-party tools well that's what zapier's expertise is with the edge cases and with the API calls that they've been doing up until now so really this is just a major extension for them and a really really cool possibility here now here's the view where you set up your actions in zapier to connect them over to Lane chain here now the cool part about why this is so magical is because if I were to click on one of these these are the ones I've already added here it's going to ask me for different properties about the action that I want to take and you'll notice that usually zapier has like 20 million different fields that you could fill out and there's a lot of really cool information but what they've done is they've condensed that down to just the key pieces of information that you need to do in action and they have this new feature here which is really where all the magic is is in this example where I want to send it to slack who do I want to send it to normally you'd fit this in with a like a static or dynamic value based off of some variable but right now it's have a I guess and so it's going to read that language that you've input into your model and it's going to have a I guess who do you want to send it to as a username and what is the text that you'd like to send as well and if we go back we can see that that is the case for most of these in fact like for the giphy one it's search have a I guess and so you're going to have ai for what kind of gift you want to search for if you want to check out more information head over to the zapier natural language actions API on link chain there's some really good information there I should have mentioned too that it's still a gated API access but you can fill out this form and request access and they're doing it on a rolling basis so with that let's jump into a few sweet examples all right let's talk about our Imports here so we're going to take our llm in this case we're just going to use regular open Ai and this is using DaVinci we're going to initialize our agent but then two new ones here are going to be our zapier toolkit and our zapier zapier natural language actions wrapper and this is just so that it can interact and play nicely with land chain and then also us to import some of my um or my API Keys one thing to point out as well of course you're going to need to pass your open API key to your model and you can do that via an environment variable or you can just pass it in directly in this case I'm doing the environment variable and you're also going to need a zapier nla API key as well and I'm passing that as an environment variable here so it's not too complicated well there's a lot of complications underneath the hood but in terms of numbers of lines of code it's not that bad so we're going to initialize our llm we're going to create our um our zapier wrapper and this is so that Lang chain can interact with the natural language API from zapio there and then we're going to load up our toolkit and this is so that we can tell our agent what kind of tools are at its disposal and then we're actually going to initialize the agent and we're going to throw it in right here so let me go ahead and run that awesome looks good and one thing I thought would be helpful is well let's actually look at the tools that have been loaded up in this toolkit so um in the background I've loaded up and connected different accounts to my zapier instance that I did through the development portal for this API and with these different tools I've attached a few cool ones here so I attached my Twitter so it can start to create some tweets I attached to giphy so we can find some gifs I attached slack slack for some direct messages uh Gmail create drafts this is so that I can start to create drafts within my email really easily uh slack send Channel message and I also want to be able to find emails within Gmail so that we can run through a few cool examples here all right so the very first thing I'm going to do is I'm going to call the agent and I'm going to say dot run now I'm going to give it a natural language instruction that it's then going to pass to zapier and go execute some things for me so summarize the last email that I received from Greg at data independent so I use my data independent email and I sent it to one of my other emails and that's the one that I connected here send a summary to the trending domains channel in Slack well let's go ahead and run this and see what happens here so the agent is gonna kick off and it's gonna start to think out loud because we said verbose equals true up here and so it says I need to find the email from Greg independent and then it says it's going to go find the email and find the latest email okay cool it did that it found the latest email which is really sweet and now the ad has the email it needs to summarize it and send it to the trending domains uh channel in slack it's going to go through it's going to go through there and here's the actual message that it's sent I wanted to show you what it just did so right here I know it may be a little tough to see um VC Ventures is interested in collaborating with Thimble and providing instructions funding or fun ideas and so let's go ahead and see and here is actually that email that was just sent and this is a fake email but this is written from BC Ventures what are you doing we love what you're doing how can we help so it just grabbed my email from my gmail summarized it and sent it over to slack that is super cool the next thing that we're going to try out here is I want to do get the last email I received from Greg it did independent so that's same one summarize the reply and create a tweet okay I'm gonna go ahead and do this one and I'm getting this ready over here so you all can see it let me know I blocked the screen quite yet and so it's going to create the Tweet let's see if I can see it here we go Greg from great data independent wants to collaborate with Thimble hashtag partnership I'm going to go over here and I'm going to refresh this and look at that there's that new tweet that was right there so all of a sudden link chains interacting with my Twitter which is still just blowing my mind which is super cool okay all right the next one that we're going to do here is get the last email I received from Greg at data independent create a draft email in Gmail back to Greg with a good positive reply let's go ahead and do this one so it's going to go grab that email awesome same one we've been looking at there's the email then it's going to ask for a thought it needs to create awesome action input create a draft super cool and it's going to create the draft right within my Gmail here so right here there's no drafts that it's preparing for me let me go ahead and refresh this and there's a draft waiting for me right there so you'll notice that the formatting is a little off and there's probably some post-processing I could do to fix this up but I was too lazy for this one um so then and now it's creating drafts for me which is really really sweet and for the last one let's do a fun example uh get the last theme I've received from Greg a date independent find a good gift that matches the intent of the email and send the GIF to the trending domains in slack so I'm gonna go ahead and run this and let's see what we can get here cool so we got the latest email which is great now we need to find a gif find a gift that matches the intent of the email and we're getting observation null here so I did not get a nifs and not be able to send it okay not enough information provided in the instructions missing search so as you can see it's not perfect right now while it's still in beta it's it's early times that's completely okay but there are the seeds of some really cool uh capabilities here all right we gotta end on a winner here though so create a tweet that says Lang chain and zapier is great draft an email and Gmail to grega data Independence sharing my tweet with the personalized message all right let's go ahead and run this one here I need to create a tweet awesome that's perfect send a tweet and so here's the really cool part is here's the text of the tweet that was sent this is when it was created and it returned back the Tweet URL for us this is all the zapier magic that was happening in the background here then it's going to go and create some drafts let's go ahead and check look at this I'll zoom in this one's just made oh that doesn't look good let me confirm if that's the right one now oh there's two drops that was from a previous previous one there we go just check out this tweet that I posted and if we actually went to this URL we are going to get zapier plus Lang chain is great I'm going to leave that one up there in case anybody wants to go see it so you can see here how there's some really cool tools about how these are going to work together and I'm super excited to see what you're gonna do so please leave a comment tweet on me subscribe do whatever you got to do I'm curious to see what you're doing uh we'll see you later
Info
Channel: Greg Kamradt (Data Indy)
Views: 22,092
Rating: undefined out of 5
Keywords:
Id: 7tNm0yiDigU
Channel Id: undefined
Length: 10min 1sec (601 seconds)
Published: Thu Mar 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.