How to Quickly Build LLM apps | Build LLM apps | LLM-based apps | Build apps with openAI

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's assume your boss walks up to you and tells you that tomorrow there is a client visit and I want to showcase something in gen AI okay so you are not prepared to do this you have limited time and you want to build something quickly in gen AI for demo purpose so this is a problem at hand and I'm going to solve the same problem in this video I'm going to show you how quickly you can build some gen AI apps that you can use for demo purposes and to impress people new to the world of gen Ai and mostly AI let's see that so guys without wasting any time let's go ahead and try to do the integration of open AI with local python okay and for that what I have done here is I have stored my open AI key in a file called my key. py okay so this is a safer way of doing it in case you are sharing screen and these things right otherwise you can pass your key as a string also no problem so what I have done here I have put my key inside a file called my key. py and I'll go to my python script and I will import my key as you can see here so what I'm doing here I'm importing open I'm importing OS I'm importing my key then I'm just taking from that stored file I'm taking the key okay I'm passing that as one of the envirment variable and I'm passing in open AI that key as an involvment variable so nothing fancy Happening Here guys I'm just picking the key from this file and I'm passing it to open module okay the bridge is this envirment variable because it's better to do this if you do in collab at se sometimes it gives issues so if you do like this right it's safer and easier to do it okay so I have passed my key and now I can write a prompt like this give a stepwise process to prepare cake okay and I will simply say CLI do completions create model I'll use GPT 3.5 turbo prompt maximum tokens temperature is something based one parameter of llm based on which llm becomes more creative or more stable and more um you know uh it is basically how creative and how much Freedom you are giving to your model okay so more temperature means more freedom and more creative less temperature means model will give you stable outputs okay and here what I'm doing I'm just taking the text and I'm printing It Whatever the response as you can see this is app Aman 1py file in my uh anaconda or Jupiter so I will simply go to my anakonda prompt here and I will call that file for example python app let me see the spelling Aman app 1py okay Aman app 1. py okay so let me call this file here and what I'm expecting in is based on this this prompt right it should get me the response from openi okay since I have asked for a stepwise process to make pizza so it is taking some uh cake so it is taking some time okay so 13 step process as you can see I have got from my open AI that response now if I go ahead and change the process here for example give me a stepwise process to apply for job as fresher okay apply for job Edge fresher I will just clear screen and I will rerun so when I rerun you can see that you know my uh my prompt will go hit the server and get the result meanwhile what I'm going to do is I'm going to change few things here so if you are seeing here I'm passing the prompt as one hardcoded value what if I want to make an app and pass this through an app okay so let me try doing this meanwhile the the response has come identify your career goals follow up Etc so this is your job searching stepwise process okay second prompt now let me go ahead and import a package called streamlet which gives you a very nice and easy way of um creating applications okay uh import stream lit as St I will say and I will just give title to my app okay and I will say Ammon app for Ammon app for fun okay and this time my intention is not to pass the prompt directly rather take from the user so what I'm going to say is user uncore input is equal to St do text underscore input and I'm going to say here please please enter please enter prompt here okay so whatever prompt I want once the input comes right I will pass this input in my previously I was hard Cod hard coding now I will pass this and when the response comes right in place of print uh generated text right I will write in the output so I will say St dot write okay and what I want to write I want to write the generated text okay so let's save this and let's try to run this here so let me go here and I will again say CLS and this time we have to run using streamlit okay because this is an app streamlit run Amon app 1. py let's see what happens so if everything works as expected we will see a web page here and once this web page comes right we can ask a question here modern stimulate text okay I think some Mis misspelling has happened so let me go back and correct it quickly so text input input input text input okay so meanwhile every time there is some issue in a stream L tab you should press a contrl c okay that will stop it and then you can relaunch it okay so if you first close the browser right sometimes it becomes a problem so contrl C and then close browser then relaunch the app okay so that's what I'm trying here and this time I'm hoping a text box will come and we can enter our prompt there so please enter prompt here give give me a nice joke okay why don't scientists trust atoms because they make up give me a nice joke about boss okay so some some jokes are coming so what I'm trying to say is this is a app that can be deployed and this is giving you some jokes or whatever it is um you know whatever you ask here it will come okay so for example I can also ask give me a give me a way to get promotion in job okay so this is coming from openi now this is a very basic app that I have built we can make it little more uh little more interesting okay so let me go and try to do that so it is giving you a basic way to get a promotion in job now what I want to do is I want to first of all control C so that my app should be stopped and then close from here let's go here and take take one more input okay so for example user input one and user input 2 okay and this app I will make it as Ammon app for recipe generator so I'm just trying to show you guys how you can play around with all this and make some lovely things for you okay so please enter your first in gradient okay and here I will say I have just two ingredients and I want to make an app okay uh make a recipe okay please enter your second ingredient and in the in the prompt right what I'm going to say is I'm going to say uh suggest suggest a good suggest a good Indian recipe using okay and then I will do a plus and I will take this variable using let me give a space here this plus and okay plus second one so what I want to do here I want to just get a good Indian recipe from these two uh prompts okay these two inputs let me try running the app again let's see what happens please enter your first ingredient let's say oats please enter your second ingredient let's say honey and let me see what the response is oats and Honey granola bars okay so this is the first one uh let me take rice and let me take honey okay so this is they should give me some rice and honey combination for Indian recipe Indian I have mentioned or not I just want to see yeah Indian I have mentioned so I'm I'm expecting an Indian recipe only okay so it is taking some time maybe this is a weird combination rice and honey but still let's see what the open AI has to say okay honey glazed vegetable plow okay so this you can make like this and this is second app now the third app is basically uh another interesting app so what I'm going to do is I'm going to take the select box of stream Le this time okay so let me go here and the name of the app will be let's say Amon app for message generator this time okay and in message generator what what I want to do is I want to if you go to stream lad page I'm I'm knowingly showing you the documentation because you can try out multiple things here what I'm trying to do here is I'm trying to put a select box here okay like this and let me try to show you what I mean by that let me comment this let me comment this and I will go here and I will say option one okay option one please enter your relation please enter your relation and here I will say mother okay father mother father okay sibling sibling then I will say boss and then I will say wife okay so these many relations I'm taking and I will say what is my context of the message okay please select your context okay so I will say thank you I will say plan holiday I will say apology okay and I will say um let's say leave applying leave something applying leave and let let let's keep it up to here only okay so these relations and these are the contacts what I will say here is um write a message write a message message to my okay and then first input which is option one option one and um about I will say about about and I will take this okay let me save this and let me run the app one more time to see what happens now so app is running so I will just stop it first and I will close this also and then our app is changed now okay so let me run one more time and see what happens so when I run one more time I should be able to see to uh select boxes there one select box for delation for example mother other select box is thank you and I think one version of app is running in background so it says dear Mom I want to take a moment of gratitude to so thank you blah blah blah I will go here and say wife and same thank you so this is my dearest wife I want to take a moment and if I say boss or if I say wife and let's say apology then maybe a different context a different message will come okay and if I say here sibling and apology then tone of the message and uh content of the message will change so what what you can do here is you can change this temperature and there is something called top P also that parameter also you can change and see how the message is behaving differently but more importantly how we can make quickly the apps using stream L and open AI package right and in stream late if you go many many options are there for example I can put a slider here and in that slider I can set my temperature okay and um many things can be done okay so for example I can I can Twi tweak my prompt such that it takes input from here all these things can be done which uh I leave it to you for practice but the the intention was to show you how we can quickly build apps and multiple flavors we can build okay I'll see you all in the next video guys wherever you are stay safe and take care
Info
Channel: Unfold Data Science
Views: 1,607
Rating: undefined out of 5
Keywords: How to quickly build LLM apps, build llm apps, llm based apps, build apps with openai, opea ai api, openai api key, opeani streamlit, streamlit openai chatbot, streamlit openai api, opeanai whisper streamlit, lanchain streamlit openai, streamlit python, streamlit chatbot, streamlit app, streamlit web app, streamlit llm, streamlit tutorial python, chatgpt streamlit app, chatgpt streamlit langchain, chatgpt app kaise use karen, chatgpt app streamlit, unfold data science
Id: D8VlcNryhbI
Channel Id: undefined
Length: 14min 26sec (866 seconds)
Published: Wed Mar 27 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.