Build Chat AI apps w/ Streamlit + LangChain

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay let's talk about the next Paradigm sheath in yellow lamps and that's about thinking of this large language models these llms as general purpose foundations are foundational models if you prefer on this foundations you layer on modular toolings and agents that are specialized who is targeted for specific tasks so instead of asking chat GPT a question like what is the stock price of XYZ or where's the nearest pizza place or even outside to do a math question like 17 to the power 7 to the power of seven well this is the right answer for one zero three three eight six seven three I mean just look at the number of digits you know this is already wrong this is already off it looks like it's not all right and then you just go and mess it up there are the countless examples on those things for example you can read papers about how you could ask GPT to do things like how many teeth does a person have 32 how many teeth does a math teacher has 47 what's the date today it doesn't know the day to give you some random date what is 1982 plus 39 it says 1 981 this is wrong how can it could go smaller and they all point to the call limitations of language models right they don't have success to other relevant knowledge and so using a language model to solve things like the ones here that you see that's generally a poor feed right so these are the limitations we wouldn't know the stock price you wouldn't know the weather you wouldn't even know the current date it's impossible by the design for pre-trained language models to keep up with this Dynamic formation lack of access to proprietary information sources again it doesn't have data on your own HubSpot doesn't have data on your own CRM your own csvos your own Gmail it doesn't have those data so if you try to ask it what is the total sales from this Department versus the other department at the last quarter he doesn't know how to get that because those are proprietary information sources but essentially why Jupiter consistently get these kind of things wrong is that they're not it's not a calculator right first of all it doesn't have a computation mode what it does is that it's a language model it generates tokens and generates tags right so instead of asking check GPD to do these things we're going to talk about this system called the mrkl which stands for modular reasoning knowledge and language so it's pronounced as Miracle very fancy for name but it's a simple concept the idea is a thing of language models as a textual Gateway so think of it as this is kind of the Gateway right it's an interface where you express in words and then your language models will pick a specialized to an expert tool so it calls this an expert so a lot of these are different experts so additional experts right it has a calendar it has a Wikipedia API it has currency can do conversion currency conversion it can do weather API stuff so you can ask the questions about what is the stock prices for Apple this morning and it will go and find that out and then you said well I'm living in Indonesia so give it to me in my local currency so it takes the currency API again and comments to USD do IDR right any books with databases calculator so it kicks it off to all of these different um sort of it has an adapter kicks it up to one of these experts or one of these agents we'll see how to do all of this in Lang chain today but more importantly the lesson here is that these are extendable sets of modules anyone can contribute to it you can write an API you can make it work you can extend onto it so language models they're just the foundational model they take it and then they find a specialized tool that is trained independently this could be a web browser calculator a dictionary a translator a scheduling calendar app what have you from an extendable set of modules and Route the right part of the question to the right tool and this overcomes many of the limitations of language models and allows you to build a robust system that doesn't just try to make things up or hallucinate the out for everything because of the limitation of just being fundamentally a text generation device that's what it is in fact if you just search this up MLK or if you type land chain mlkl you'll see that there's a lot of documentation on this as well and what a mrql agent really does is three parts first of all the tools that the agent has available to you so it decides okay based on this query what are the experts that I need to call for maybe a calculator maybe a dictionary maybe a translator maybe a currency converter whatever right and then the LM chain that produces the text that is passed in a certain way and finally the agent class itself so if you're using SQL um SQL then you will want to have the SQL agent and that's how it does that in terms of blank chain the ecosystem is really really huge so if I click into the tools and look at the Integrations these are all the tools that are already in here and keep on adding more and more right so API 5 AWS Lambda a lot of you have used that Bing search race stage check GPD plugins.go search this is an alternative to Google maybe a more privacy respecting um search engine alright so what I'm going to show you in this video right it would be a fantastic introduction to land chain agents and we layer on stream lead as well so we have a beautiful web application running that is plugged to the web browser that calculators a database and this specialized to these experts and there are many many agents and we've seen some of them already and some of them actually even come across in earlier videos of this llm series as well so we start off by building an MVP version using these tools and agents and I'll show you some of the more advanced use cases but we generally be using stream lead and we're using Lang chain that's pretty much the two things that we're using alright so if you're ready just go ahead and open up a new file um click whatever you want I'm gonna quite demo 16 because all of this you know we've been this is the 16 demo all of this from 1 to 15 all of them are organized in a nice way and kept up to date and they always I just recently did a version bomb so all of this uses the latest version of blank chain and llama index and if you want to find them if you want to follow along right just hop over and do a fork and then clone it down to your machine from the GitHub repo all right let's get into it now a lot of the scaffolding you've seen me done this before um so I really don't want to explain too much of this basic scuffling but I'm going to bring in the environment variable so the way I do that is I said from Dot and import load.f so what this allows me to do is we just call this and it will find for a file called.env file and it's going to look at all the environment variables that are in this file and it's going to load that in so I can call them without having to put them into my code and that's nice it creates a separation this is my random variables this is my code I commit the code to GitHub to Version Control but I leave it out of anything right it's just your secret keys and tokens should be private at all times now I just said that we're going to be using length chain so let's bring in length chain and start working with it so let's start off by doing leg chain LMS import open AI and since this is all about agents working with agents I'm going to start off with a simple example I'm going to be using search engine to say if I write a query don't try to make things up instead go and consult Google search engine or Bing or go one of those right and find the answer for me right so if I ask a question like will Donald Trump be indebted in the latest a prosecution case against him right so essentially is Donald Trump going to be successful in defending his case there or will he not right so if I want to ask a question like that I don't want the language model to make stuff up what I wanted to do is to go through search engine touch that question in there look up at the news articles from an opinion and then come back with come back to me with the opinion with an informed opinion and not just make stuff up based on you know like the last trading data was like 2021 or something don't do that all right so this is what I wanted to do so I'm gonna actually be using the tools to do that and one of the tools I'm going to be using is the search so let's bring that in I'm going to say Lang chain dot agents import load tools right so there's a load agent there's the load tools there's a load hiking face tools but we're going to be using load tools now let's go on and create our llm right so we already have open AI so let's do that this is something you've seen in many many part of my videos so really this I don't even know like I shouldn't have to explain all this again if you've been following this series you know this is like what the 13 14 video this is a lot of repetition already so you've seen me done this before um nothing really new here temperature is kind of like how random do you want a response to be if you want something to be highly accurate then you want to set it up to be as close to zero as possible right if you want something to be more random you know add a bit more radiation these response and stuff then up the temperature to be zero eight over nine maybe even one all right um so let's start from zero and let's see if it's not good we can tune it up right now I want this uh streaming to be true so the texts are returned to me in a streaming manner so that they return one at a time so I don't have to wait for all of that to be generated before it returns back to me and finally I'm gonna have open AI uh API key now this is where people like put in something like this and punch above things I don't want to do that so what I want to do is I'm going to say take the OS find the environment and then what just locate open AI API key so what this means is that it expects that in your EnV file you will have something like the same thing if you talk Capital case you want to do that and you expect to have the keys here right it's just going to read that value from your EnV file and it's going to pass it right in here that's it very very simple and finally I want to have a tools here to say load tools and then here I can have a bunch of tools um you can have different tools that you want to work with right you can have the web browser the calculator translator all of this stuff now let's start off really really simple by just putting in let's pick a tool and I will go into doc dot go search and I will use this one all right so in launching the instructions are really simple as well package everything into it this is why Lincoln is fantastic so from linechain.tools import.go such run and then do this and then you can do search shot run and then you can ask for first name uh you will do that for you so that's a useful concept another useful concept is that we will also need to bring in the zero shot react description because we're using a text llm so we will first try this um this is basically the mlkl right the miracle agent for LMS so the miracle agent this uh uses the react framework the react framework based on the description of tools to decide what action to take if you try to understand from your natural language query you see that's the text can I look at the text make up my mind about what tools what what specialized tools to use all right what are the which agent should I call so this is the way you would call it you said agent type and then zero shot react description um there are a few other choices you can have if using a chat model you want to try to use memory you can pass this in if not try this one but since it says if you're using a text LM that's us first try this one all right so we're going to be using this um so it has it goes by the name of miracle agent for LMS so mrkl or it just go by the name of zero short react description and this is kind of a simple description as well and agent is the stateless rapper around an agent prompt chain such as Miracle so agent prompting is kind of the one it's kind of like the commander it's like hey I'm the commander I'm gonna pick up which agent to kick off right and that is your agent prompt chain that is a miracle that takes care of formatting tools into the prom and then as well as passing the response obtained from the chat model and then you return response so you have to sort of decide the action and the corresponding action input so it's as well given what you want to achieve this is the right action for that this is the right action for the other all right so that's that's kind of what it does get back into code and so apart from load tools I will also need initialized agent to initialize my Miracle agent and I will just use agent type and then after tools this is what I need I need agent initialize agent so if you look at the signature here it asks for tools and then llm and an agent all right so we need the tools the llm and then the agent what would be our tools the tools would just be the tools that we created right up there okay in here let's start off by doing the ddg such that's the go search we talked about that already so we're gonna say that's the first one then the llm we also created that right up here so let's say LM equals to Ln and then finally the agent now agent is when we're going to use the agent height on this it has a few here that we've seen the chat conversation now the chat zero conversational react description open AI functions and what I want to be using is the zero short react description so this is the miracle a lot of this there are documentation admittedly the documentation is not always very complete not very comprehensive it gives you like code Snippets run this and it does that then you need to read the paper to really understand what it does but I'm trying to keep the video within a reasonable time frame so I'm not gonna try to elaborate too much or labor too much on those points so these are the three different things and you're good to go what I will do is as well is I said that I want to have this as a nice web application so to have this as an ice cream application I will need to bring in screen so you want to install streamlit if you don't have it already so we're gonna say import streamlit as St and close up the sidebar Ctrl B to do that and now we just have to wrap everything into streamlined so you could say something like streamlit.chat message first of all the user have to write the prom so user have to ask a query right so I have the user and I want the user to write a prompt so change right on there and then I want to pass in the prom but prom is still not created at this point so we need to sort of say if prom then we just assign and use the wireless operator to say if we assign and if this is successful then we just put everything into check input all right so what this will do is that try to this virus operator I think is pattern 3.8 so pattern three point and above you have that it's saying that try to assign this under prom and if you're successful then call this and then what happens here is that you first ask for the user to enter a prom and then you can create a context manager said with extremely we're not really learning about streamlined so I'm not gonna go into all the details about streamlined now you say this is the assistant if you watch my other parts of the video you know that generally you call the user and the gbt roller LM row will usually avoid a system all right so the user is kind of like you you're the guy you're trying to ask it to do things for you and assistant is kind of the gbt guy the GB the LM itself right whatever you use if you use ubt if you use bar if you use some open source LM model that's your assistant so we want assistant to then say all of this rep into a context manager and the reason we do that is because all of this will fall under the assistant um so everything that you see from line 18 onwards that's all of this is gonna be a chest message uh that is responsible by the assistant this is all done under assistant role the user is just here just write your prom that's all you do right so what do we want we want to we want maybe we wanted to First say oh try to tell me that you're actually in this Loop already so we can do a print statement fit an emoji into it and then say that I'm thinking um you can just use a simple console and say hey I'm in the loop we need a simple callback uh Handler to say that if link chain is successful executes we need a callback we need to pick up a function so I'm gonna also have to bring in length chain dot callbacks import streamly callback Handler see this is the Callback finally we save that now you can have a response and this is something you've seen me done before which is adrian.ron and agent.run is really just a result from here and it says that okay execute this if you successfully execute that you're gonna get some result and with the result you handle that into this callback which is extremely handle callback so this is what we want to do we want to say running with your prom and your prom is basically from whatever user enter in here right so this is kind of like whatever is written right that's your prom run that prom and then when the function returns this is what you want to pass it back all right so call back and then finally you can write it back so kind of like what you did here in the right so now it's done earlier you said it's thinking but now you're not doing thing anymore you're really done with that so you just want to print out response um you could still have another console log if you want to but really that's just pretty cool this once all right so 25 lines of code very simple let's save everything in here let's activate our environment you want to make sure you have screened it and stuff installed right so Lang chain extremely that's the two things you need and I will just extremely run and because this is demo 16. py I'm going to six demo 16. py and so sure enough you get the nice streamlined interface just a simple user prompt all right so this is whatever you want to pass it so to see that all our code works we want to ask a question that will have to rely on using the dot go search or if you don't want that I'll go use Bing use any such engine use Google if you want to right I'm just using.go so let's start off with the first question so I could ask this for example what are the names of the kids I could say of the current American president but I saw it sounds like that's too easy you didn't even have to go and Google that up usually gbd would know the answer for uh to that so I'm gonna say maybe change it to I believe for the fifth is the former president Donald Trump 46 is a Joe Biden so 44th would be better Obama so I'm going to say 44. uh president of the United States okay all of America so what are the names of the kids of the fourth 44th President of the United States let's do that and so Iran's thinking there you go so first is this thinking this is where is this from it's just a fancy print statement all right so so take that um asking me to write something right right thinking with the brain Emoji that's it and then we um handle the response so let's go back to the problem here and so your zero shot react description first have to look at this and say okay what action do I take right it has to decide what action to take he needs to set what to answer this question I need to first know who's the 44th President of the United States and I need to find out who the 44th President of the United States is action so this is kind of what it's doing here right he says I need to decide what action to take and so the action is to do a diagonal search okay that's fair the action input is the 44th President of the United States so you need to pass from all of this it says what is the relevant input I need to use to pass into this action then he finds out the answer right so here the presidency of the United States of America and he founds out that it's actually Bara Obama for the fourth President of the United States okay fed then once it's done it kicks off the second action it says not that I have that I now need to find out the names of the kids of the 44th President so again kicks off dynago search input is the kids of Barack Obama and then to most of the world Barack and Michelle Obama are the former presidents and first lady of the United States but two daughters Malia and Sasha Obama all right so now it's completed I now know the final answer Malia and Sasha Obama let's um I know the answer is correct but let's just Barack Obama kid's name search that up so there's the name Malia and Obama and Sasha Obama so that's correct so you know it's not hallucinating it's not some making up some stuff based on some pre-trained data from you know five years ago or four years ago he's not doing that what he's doing is to execute this type of actions and then using a set of actions to arrive at that answer right so I could also do the same thing here I could say well you know maybe top three shareholders of Nvidia so thinking and then search top three shareholders of Nvidia I need to find out who the top three shelters on Nvidia are and I'll do a search and then it finds out all of this stuff look at that that's a lot of information that you need to pass but it summarized that back for you it says I now know the financial so instead of giving you all of these tags right it gives you this the top three shareholders of Nvidia the Vanguard group The BlackRock and Fidelity Jensen which is Jensen his that's his uh English name um are the top individual shareholders so again you can search that up really quickly top shareholders of a video go to CNN if you want to but here are the individual so Jensen Colette and Mark Stevens and so these are these are all correct and then let's look at the corporate shareholder so let's click on this one and here are the corporate shareholders so that's the individual at the bottom here but the top 10 corporate shareholder so Vanguard Fidelity and black rock so again we got it right so Vanguard BlackRock and Fidelity so what you have here is a very powerful system instead of trying to make up words on its own is trying to just use it as a foundational model that we have foundational layer we talked about that before at the beginning of this video and then it kicks off the right action to perform a sequence of actions and then derive an answer from that sequence of actions that is taking all right so that's good now if you know a bit of stream lead you can also make this a bit prettier you can add a few uh maybe title a big customization you can do that so let me terminate the current session I'm gonna slightly customize this a bit but I'm gonna save you time I'm not gonna write each one of them line by line so I'm gonna just slightly I'm gonna paste in what I've already had while doing the demo earlier so I'm gonna remove all of this content but this is very similar so I'm going to show you at the top it's diversity stuff so previously you see me do the load tools and then in the initialized agent before that I have my tools equals to load twos before that you have me doing this right so instead of doing that now um what you see me do is I actually remove that and I'm using this just don't know search run this is similar to what you have in a docs if you look at the docs this is kind of the same thing from line chain tools import.go search run and I just call it all right so that's the first thing I move I also added a title and a configuration so I'm just adding this page title and a page icon so it makes it a little bit prettier this is really unnecessary if you don't want to I added also a sidebar so look if you notice a lot of the changes are mainly on the front and side of things I'm saying that the first thing right I want to have a title I want to have a sidebar so what it does here is just add a simple text input right so my sidebar has only one input and that's just an open AI API key so I'm allowing my user anyone who's using my web app to just allow the guy to enter his own key and instead of using my key right so I can launch this web app and anyone could use my app as long as they Supply their own key and I pass in a type equals the password Y in order to mask it so that it's not shown in plain text right so that's just maybe better in and this has some form of recency it's pretty recent I will put in a question of like will Donald Trump be indicted but don't make this political in the comment messages okay I'm not I'm not even American actually so I'm putting this query so that this is very recent news right um I'm recording this this will go on maybe on the first week of July and by then we still haven't found out if he's gonna actually successfully defending his case or not if this were trained on a simple llm let's say gbd3 or gbd4 right it wouldn't know the answer but what it needs to know is to catch up with the most recent news so I find that pretty a good place holder to be using so this is from open AI API key this is the text input but if this is still empty by the time you hit on a prom then it says Please add your open API key to continue and then you use this if this is successful then it goes in here and plus it in here the rest is exactly the same so initialize agent the tools is the same LM is the same zero short react description is the same um the model name is the same in here I took away the console log but everything else is the same kind of right so I'm going to just run all of this and this is not demo 16. py so let's go ahead and run it again and now you should see that there is a sidebar there is a title and all of this is coming from here right you have your page config you have the title and then you have the sidebar so we see that it's working and here is how can I help you and this is also what I mentioned earlier is basically the default and who should write this before it should be the assistant writing this default right shouldn't be the user because that would be crazy so here I'm saying the assistant is going to ask you assistant again means the LM it's going to ask you what can I do for you and so now we need an API key and if you have your API key you can just go in there and punch in your own because of the type you go to password the HTML form is going to hide it by default so that's nice and now it's gonna be ready to take our commands so suppose you want to ask well donor from be indebted now if it's not doing the Google search it's not going to be able to handle this query it's going to make up stuff Donald Trump has been indicted on 37 cons and has pleaded not guilty to the charges all right so at least he gets the answer but how does it do that well he first search I should search for current news updates on whether Donald Trump will be indirected and then there's a search then this is Donald Trump and in fact he even went further I mean shoot this is a shoot it's definitely a shoot so instead of actually using this as is it actually went on and format that a bit as a search for Donald Trump indictment news and here the charges against former president Donald Trump who was indicted by a Federal grand jury this week um 37 um and this is correct this is the latest news anyway we don't know and again please don't make this political I don't know I don't I'm not American myself right but I just need something that is very recent right um there is also maybe another thing that's really very recent if you've been following the news is uh maybe have you found the wreckage for Titan or submersible and just maybe just do that and again try to do a search Titan submersible wreckage so yes the wreckage of the Titan submersible has been found based on such result it seems that the wreckage of the Titans submersible has been found and there were fatalities involved all right so you see what it's doing here is that it kicks off that search right and now you have the open AI key on the sidebar and that's pretty nice pretty neat now if you were to follow along the documentation that's pretty lengthy you can read out more about this stuff but I'm just gonna hop to the last part of this because I don't want to video to be too long I want it to be ideally like 10-15 minutes so I'm going to show you all of this let me run through the app for you and then let me give you a quick look at the code itself right so it says you can ask one of the sample questions or enter your API key in the sidebar to ask your own custom questions so we have the sidebar this is the same thing here's the API key you can enter there and you can answer your own question or you can ask one of the sample questions now the sample question itself here it's set up there is a few like there's two questions here already so the first one is what is the full name of the artist who recently released an album called the storm Before the calm and are they in the football database if so yeah yeah question if so what albums of theirs are in the football database so now instead of doing the search and kicking off something like a goal of Google or Bing instead of doing that it's now realizing that the action is going to be a bit different so I need to find out the artist's full name okay so you first have to rely on search still so this is the same as what we've seen before you still need to find out because here we didn't give you the name of the audience we only asked it to figure that out what is the full name of the artist who recently released an album called the storm before the car all right so I need to find out the artist's full name and then I need to search the football database for their album so the first one is to First find out who is the artist for the storm before they come defines not the answer that's Alanis Morissette I don't know if I pronounce the name correctly it then take its name and then you pass into the second action now instead of actually using the search it says I should look at the database so I now need to search the football database for Alanis Morissette album and then here's the action input what albums of Alanis are in the football database then it generates the single query for you now if you wonder how it's doing that and stuff gbd 3.5 and gpd4 they're pretty good at going from text to SQL in fact I have a video covering that if you want to watch that video there is a on my LM playlist I have one that goes into how you could write a nature language and then you can query your CSV you can query your database and it would kicks off an agent and execute the query for you and retain retrieve the results back for you so here it figures out that it needs to write this query so Select Title from album inner joint artist on album and doesn't it doesn't just need to know what kind of query needs to generate it needs to know what chain to look at so if I show you the code for this this is the SQL SQL database the SQL database actually both of this stuff you have seen me done this in my earlier video so I have a video that goes into like text to SQL and database and stuff if you actually been following along this path you've seen me done this before so this is from the SQL database chain which we bring in from here all right I also bring in the math chain because I also wanted to do math and stuff so remember how I said earlier when you use gbd3 and you ask it a question like say 17 to the power of 7 for example if we don't know the answer do that sometimes you get it right but a lot of times you get it wrong and it's not the kind of things that you want to roll your dice with and say oh just try and generate text and try to try to tell me what the answer you think would be that's generally not the right tool for that what you want the LM to do is to not try to solve that but when kicks off another came to solve that get the result right so the expert in this case the expert with the calculator get the answer and feed it back to your LM you won't need to do that so here we have the search but these are all the tools we have the LM this is very similar stuff then we have to search this is the data go search wrapper and then we have the math chain then we have the database chain and then we have this and then we just have to pass in all the tools into the tools this is something you've seen earlier in the two two or three demos but here instead of an array with just a length of one we have an array of a list of things so here we have to search with the calculator and the football DB here I'm saying that the search this is gonna kick off search dot run which is from here this is going to kill dbchain.run and it's going to kick off lmf chain.oram but you can add a description to sort of remind yourself what this is doing all right the database itself is actually in my folder again all of this is on my GitHub you can go and download them or just do a gig clone so I have the you know there's the assets that's the audio there's the book that's the DB so look for this DB and then this is what it's looking for all right so it's going to look at this DB and this is called a DB path if you just say go in there use SQL like um find a DB puff and then form a connection there and just execute on that let's go back to our web app so now once it's executed the SQL query it finds out that the albums of Allen is in this football database are Jack later peel and now it says complete I now know the full answer or the final answer the audience will recently released an album called the storm before the column is Alanis Morissette and the albums of hers in the football database I check later peel okay so that's pretty nice right so let's look at another question here who is Leo DiCaprio's girlfriend what is the current age raised to the 0.43 power so here is trying to test two things at the same time first test the search and then test the math chain so it needs to be able to do the math here so let's submit the question if you're only using gbt you're probably Gonna Fill here so but here now that we have the math chain it's probably going to be able to do a reasonable job at that so search who is Leo de Cobra's girlfriend so it forms his thought process it says in order to do this thing I need to First solve this problem right who is Lily Copper's girlfriend so there are four different actions here so I need to find out who you recover his girlfriend is and then calculate her age raised to the 0.43 power and then search uh Leo was also linked to Megan Rush Roshe Russia allegedly entered a relationship with 19 year old model Adam colony in February 2023 I'm very bad at nymphs because you probably know I don't live in uh in the US so I'm really out of touch with the Hollywood and the pop culture and stuff how old is Adam Eden Eden all right search and so 19 years old all right and you can verify that right how old is hidden it's really Jewish 19 years old okay and then what calculate calculate 119 to the power 0.43 and I use a calculator in fact it doesn't really use a calculator it uses the num expression value so using python to do that for you and it gets the answer 3.507 and then complete I now know the full answer or The Final Answer Liberty Copper's girlfriend is Eden polany and her current age raised to the zero form should be 43 power is this now if you want to ask your own question then these are all cash so and you know they are cash because here I actually pass in the Pico so here a person pickle I mean these are from a dog these are not my example the the first and second you know I modify them I make them easy to condense them within 10 minutes to show you a quick demo but this one here is pretty much just a lot of them are just copy and paste from a docs and then I just have to change everything into a database and stuff so that I can show you in this one file and so what you see here is the question the query so this is the input query right this is the user input query so this is whatever user right so you save them into a driverical user input if this is already being cached before if it is in a safe session then just tell me that you're playing safe sessions so here you see it in the console log using plain save session so confirming that it's actually using a cashier and that's basically a pickle right and then finally print the answer and just run it through otherwise just run it normally so this is the initialize agent this is something we've seen before so very very similar right like 80 90 similar to our examples except here we added the save sessions idea of like hey you don't actually need need to rerun the whole thing just use the playback callbacks so the main new idea that was introduced is this area of playback callbacks the rest all of this stuff you've seen me in other videos you've seen me done that earlier in this video or in other videos I've seen those things before I'm really just try to catch introduce caching to it or if you want to learn more about caching I have a video go completely about caching all the different caching strategies in line chain if you want to study more about cash and introduce caching to your own llm pipelines then just go and watch that video itself and so there you have it I said the video is going to be short I hope I managed to cut it down to a reasonably short time a lot of them a lot of people have been telling me that the videos are a little bit too long now so I'm keeping it to hopefully everything done within 15-20 minutes if you want to see more I can go into a more deep dive and stuff but here is a really simple tutorial on how to combine but Lang chain agents and stuff and put them into extremely web app because I think I have a lot of questions about that before I was like okay this is cool I don't want to run it on my computer only I want to have it as an app so that people can use it and stuff so this is kind of the way you do it using stream lead if you want to see it in flask in Django there's also a lot of other resources to find out about that but if you want to see me do it then just let me know in the comment sections right so I hope you learned something new I'll see you in the next video goodbye
Info
Channel: Samuel Chan
Views: 16,940
Rating: undefined out of 5
Keywords:
Id: 7QR6hXx_Nms
Channel Id: undefined
Length: 32min 11sec (1931 seconds)
Published: Fri Jul 14 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.