have you ever tried asking the dpic API for realtime data information unfortunately that's not possible all AI models including the dpic API have a knowledge cut off at a certain point in the time but imagine an AI that could tap into life gole search result map and everything else on the internet that's exactly what we will explore in this video the dipic API itself doesn't provide a feature to provide a real-time information but we can integrate it with other apis to achiev this you're probably thinking H we need to scrap Google right now don't worry Sur API offers easy API to access search engine results like Google search make sure to register at dps. com to get your API key as well as at Sur ai. com to start getting the answers from the internet here is how first the user gives us an input with a natural human language like this then we need to extract the important query that we will use as a word to search on Google later for this we are using just an output API by DPS to extract structured data from a natural language like this we can have multiple data as well but for this we only need the keyword to search in Google and now to perform a search on the Google or any other apis we are using the Sur API API so we will take the keyword and pass it to the actual function later I've prepared the directory for my project first make sure to install the open a is SDK since dips is compatible with it next we need to install the python.
N file to get the API key from our environment file to store our API key securely now move to the text editor here is the basic chck completion method that I've prepared first we will import the open AI SDK and then using the NV package to load the file from the NV file as you can see here in my n file I've stored two keys first for dipic API key and second for API key that we can use later so now we can grab the DPS API key that we stored securly on that file and store it in this variable and then create the client instance using the openi method for the parameter we have API key and also the best URL is apid dip. com now for the method we are calling client. chat.
completion.