LangServe by Langchain - APIs have never been EASIER

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone welcome back to the channel today I'm going to be going over quickly a new announcement from Lang chain that came out a couple days ago Lang Lang serve is a new way to deploy our Lang chain applications and so essentially you can read the article yourself I'll put it in the comments um but basically what this Library lets you do is add production ready API routes to your fast API server so you can quickly iterate on API endpoints for your large language model app applications so let's get into it the main things that you need to take away from this are honestly just kind of the setup so here's their example of you know creating your own chain on your server in chain.i and then in your server file where you'll be running your fast API the main thing you really need to worry about is this add route function so you can import your chain from your chain file above and then you simply just add routes to your app with chain and out of the box you get all of these end points supported and so I'm going to be showing you just a quick example with Postman and a simple agent server that I have set up so first I'm going to go over the server and what I'm using so I'm using fast API I'm using agent executor chat open AI opening ey Tings etc etc you know the deal if you've been working with agents and in Bings for a bit so so right here is just a simple agent chatbot that has some information about me I like coding I like lifting weights and I like making music We Are defining our tool with the tool decorator here definition at tool get Merk thoughts and we are returning the retriever as get relevant get relevant documents query and then we are initializing our tools we have our prompt your Merk's personal assistant our large language model Chad open Ai and then large language model with tools bind the functions format tool to open AI function tool for tools and then we have our agent here with the inputs and the agent scratch Pad of course and yeah that's pretty much it um and then down here add routes to the app agent executor input type I made inputs output type I made type outputs and I'm currently running the server so I will show you what this looks like St on Local Host 8000 you can see I already said hi so it's saying hello how can I assist you today if I can zoom that in a bit I don't you guys can see that what does MC like to do and it's sending the request MC likes to do various activities some of the things MC likes to do include lifting weights coding and making EDM music and another one what is Merk's favorite activity for working out just example it's weightlifting he enjoys challenging himself and building strength through lifting weights and that's about it so basically what you can do I honestly should have put this agent stuff in another file probably the chain file where I was working with this out of the box chain that you get uh from initiating a lang serve project um but I think this is pretty cool I think it's a very cool way to add end points add Hawk and make it a bit more flexible while you're in the iterative process but you still want to you know get test and feedback from other people and not just keep it to yourself so so you can imagine you know you have a chatbot for a website and you're trying to work on different functionalities for it and you don't want to worry about all the API endpoint setup you could just make your functions in different files your your different chains and your different agents for the chapot and then add them to the fast API routes and then just call the invoke with the proper key that is expected so for this it was input um but this could also be you know like topic if that was topic and that's that's pretty much it for the video guys I just wanted to give a quick overview and make youall aware that Lang serve exists and that you should all be trying it out it is fresh out of the oven so no better time then to get started right now and now if you think about it we have Lang serve for production ready API end points and we have Lang Smith for observability and Trace backs for all the functions you're using so I'm honestly pretty excited I'm pretty happy with the entire ecosystem that Lang Chain's been building out it's not even been a year I think it'll be a year in November since they first started working on it so pretty hyped for everybody in the community and the team if you're interested in learning more I will drop the get Hub repo for all of this in the description below as well as the blog and the Lang chain documents um but that's pretty much the video I just wanted to make everybody aware and show you how to use these new fun tools that Lang chain keeps pumping out so hope everybody has a good rest of their week and uh yeah there's no outro so uh goodbye
Info
Channel: Michael Daigler
Views: 4,847
Rating: undefined out of 5
Keywords: langchain, langserve, langchain tutorial, langchain tutorial vscode, ai, openai, chat bot, langchain agents, langchain chatbot, langchain agent chatbot, ai agents, langchain agent tutorial, fastapi, fastapi langchain, langchain fastapi
Id: 7U82wfZEP9s
Channel Id: undefined
Length: 5min 21sec (321 seconds)
Published: Sun Oct 15 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.