Current location: Homepage > solidity > Generative AI Full Course – Gemini Pro, OpenAI, Llama, Langchain, Pinecone, Vector Databases & More - Ep45

Generative AI Full Course – Gemini Pro, OpenAI, Llama, Langchain, Pinecone, Vector Databases & More - Ep45

2025-07-11 11:51:31 [c] Source: ByteGenius
this I'mextracting a value of this particularkey you you can ai programming pythonsee over here let meshow you so this is what this is mydictionary now on top of this dictionaryif I will call this get method now uh byusing this uh key so get and over herewhat I will do I'm going to write it onthe key so the key name is what locationuncore origin now over here see if I'mgoing to run it now you will find outthis Delhi so this is my origin and hereyou will find out the destinationsimilarly I can get the destination alsonow it's not a big deal see now overhere I can call this a destination whyI'm doing it entire thing will be clearand I will give you the quick revisionalso just wait for some time just waitfor more 5 minute everything will befine so Delhi is there Delhi and Bombayis there so here we have origin anddestination now we got both origin anddestination right so parameter is uh weare able to get a parameter we are ableto get origin and destination now let'stry to find out the flight detail rightso let's try to fly find out the Fflight detail so for that basically whatI'm going to do here I'm going to callone uh so here I'm going to call onemethod that is a a right so what this awill do so here actually I'm going topass the name so let me show you thisparticular value what is happening overhere so just a wait let me copy andpaste over here so this is what this isthe name this name is what this is thefunction name get flight informationright now I'm giving this uh functionname uh this uh function name this GLget flight info which is a string as ofnow let me show you the type of thisfunction over here so over here what I'mgoing to do here I'm going to write itdown type of this function so this typeof the function is nothing it's a stringonly so let me uh keep it inside thebracket so this is what this is a stringnow if I'm passing this thing to my evalfunction eval method so you will get theactual function this eval is doingnothing this EV is giving you the actualvalue that's it this is what this is thefunction now we have defined get flightinformation it will give you the actualvalue that's it so here you can see itis giving me the function only this iswhat this is my function this get flightinfo is what it's a function now it'snot a string we have already defined itover here see this one so this is doingnothing it is just giving me actualvalue okay now let me show you oneexample very basic example let's say ifI'm going to write down and here if I'mgoing to write down two now tell me whatis this two if I'm going to write downlike this uh type and here I'm going towrite it down two just tell me what isthis it's a string but two is a stringno it's aninteger right it's a integer so if I'mI'm going to write it down like this nowif I'm passing to my so it will providean integer see this is what this is aninteger if you check with the type sotype the type will be an integer only soit is converting whatever value we arepassing into the well method now it isconverting into a original format into aoriginal form so here we are getting afunction so this is what this is myfunction which I collected over here nowI just need to call this particularfunction so here I'm going to call thisfunction now after calling thisparticular function I will be get seehere I'm going to pass the parameterkeyword argument keyword par like thisthis particular parameter params thisone okay location origin and locationdestination this two thing we want overhere this one right now once I will runit so here I will be getting my detailsso let me run it first of all uh whereis a perms here is a perms and here iswhat here is my flight details so namedate time is not defined let me Definethe date time overhere so from date time on of date timeimport date time and it is done I thinknow let me runit time Delta is not defined let mecheck what all import statement is therejust await time Delta also we can import fromhere itself so this is going to be atime Delta great now let me run it andover here you will find out a detail seeso actually what we are going to do uhthis function actually uh you can thinkit's a it is working as a API got it nowhere what we are going to do so we areextracting a information from the uhlike whatever prompt and all we arepassing now so from there basically weare extracting an information and we arecollecting a detail of the flight okayfrom U like this is the responseactually see first what I did I defineda function this is what this is myfunctionthis is what this is my function rightafter that we are calling the uh afterthat we are hitting to the uh like modelby by using this open API now afterhitting it so actually whenever we arechecking with a response so in argumentactually in a function argument we havethis two thing now by using this twothing now what we are going to do so weare uh like extrating the informationfrom here so as of now this is thisfunction actually you can think it's myAPI but you can call actual API by usingthis particular information that is whatI'm doing over here just just think overhere that is what I'm doing so now whatI did what I got tell me guys so I Icollected the information whatever see IDefine the thing inside my functioninside this particular function okaythis one this is the value this is thelike parameter which I defined now I uhI like called my model I called my openAPI and it is hitting the

(Editor: c)

Recommended articles
Hot reading