Create Advanced AI Assistants with Azure Open AI Assistant

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
now with recently added assistance API on Azure you can now create your own complex co-pilots that not only generate text but also it will let you automatically and intelligently trigger your functions your codes or your even apis with even leveraging your own any type of data then let's go before we start make sure you subscribe and hit the Bell icon so you will get notified for the next video thank you all right let's talk about what is azure openi assistance API well this just added to Azure open a couple of days ago I believe and the time you're watching this video and recording this video it's in preview but what is assistant API I mean mean what is the proposed value of assistant API so technically when you want to create llm applications and dealing with large language models and llm apis like opening API here these apis they're stateless that means they don't have sort of a memory to store all the chat history and stuff and this is a challenge so you have to as a developer manage the threats the chat hisory create a memory and sort of include anything needed to perceive that thread of communication to llm but V assistance assistance API it is actually a stateful not only it is a stateful but also it will let you to connect your llm to other type type of execution of tasks that you want to do right now simple llm just can answer a question or generate a text here for us but what I going to do I want to create an application that not only can generate text for me answer my questions but also let me trigger some other functions some codes and some apis and even load some files data sets so it's sort of Beyond an llm uh text generation use case so let's see how we can do so if I click on assistance API I'm going to show you that in UI for learning purpose but this is definitely doable through code as well um by the way there are certain specific regions that you can have this assistant API I in eus2 region so this is currently available there that's why I have my asual service here if I click on assistant API you'll see I can create a new one if you click on new you have to give it a name let's say I want to create an assistant as you just saw I created one before but I going to create another one housing assistant so what I'm going to do I want to create a houses housing assistant which is a virtual assistant here using GP 4 as you can see to answer questions about some houses listed houses and I I going to use the bostone housing list data set from cyler and if I'm interested to a particular house I want to let the chat but connect me to an agent so that's you can see that I'm executing a task that's why I need assistant API here so what's the instruction I'm going to say that you are a help assistant blah blah blah that do this and that so I've already created that I'm not going to create but I'm going to tell you what these boxes are now the deployment the model that I going to use for this chatbot is gp4 and what is function so functions are the definition of your apis codes anything that you want your llm decide if we need that function to get triggered or not so let me give you an example if I click on ADD function asure opening already they give you two examples for example the one that get a stock price so this is how you define a definition for your function so llm will decide do we need to call this function or not for example at the middle of the chatbot if llm understand that oh I need to get a stock price because of the user question so it it will check out the function definition and based on the description of the function that I have here it will understand that okay I need to call this function and what are the inputs of this function these are actually defined here for example one type is s symbol which is I think the company name let's say Microsoft is stock price msft and that's in a string and what is that input this is the stock symbol and it is required how about another one get better the same thing there's a description for that and there are some bunch of inputs that needed for this function which is uh the location of the place that we're going to get the better and there is something else unit which is uh F height or centigrate Celsius sorry so now this is the way that we Define the function but you might question me that okay where is the python code that does actually get the Vera data or where is the python code that received the stock price those python code stuff are something that you need to develop by yourself or of course you can use GPD models to generate code for you but here the assumption is that you already have a function that get the stock price in Python code this is just a definition and llm just need the definition of your function to tell that hey I need to trigger this function or not and based on that answer of llm your python code going to get triggered okay so for this housing assistant I created a new one I'm going to show you so let me go to my the one that I created housing assistant you will see that this is a name your a helpful analytics assistant that analyze housing data set and there you go I have a new function created let me show you what it is so this function is when the chatbot will decide that the user want to contact to an agent and talk to an agent this function should get triggered this is the description I have defined and what are the inputs to call this function to contact an agent uh one of them is RM which is the average number of rooms for that house that should be defined by the user and age of the house these are just an examples like it can be anything so as long as the chatbot knows this and the user say hey contact connect me to your agent this fun should get trigged and decided to get trigged by llm and we're going to check that out and both of them are required as an input so let me save it and nice thing here add it here is code interpreter so when I enable this on backend Microsoft will uh provision a Sandbox of python environment so any code generated by llm can get executed under that python environment so I want to enable that and this is also a new feature added here and files of course I want to give the list of my houses um to this assistant and let me show you first how my data set look like let me open up my uh Boston houses there you go it's on the other screen so these are list of houses with different information about for example actually I have a text file which is the metadata information about these columns for example as you saw a is the not necessarily the age of the house but RM is the average number of rooms per dwelling so I want to give this text file and this CSV file both of them to my assistant API to make sure when it works as a housing assistant it has access to these data sets so I click on add files upload the first one is my uh Boston houses there you go I just upload it okay it's going to take me a couple of seconds there you go and I want to also add the text file that I showed you which is here data set attribution I'm going to click on upload all right as you can see both files are added and I believe my assistant API is ready to get triggered so I going to click on Save and making sure that our llm can access or our assistant I would say can access to these files and the code interpreter which is a python environment is working that can run the codes not just generating them let's actually do something I want to ask that hey do some experimentation analysis on this data set I want to say do Eda on housing data Eda stands for experiment data analysis right so no question let's see what it's going to perform all right as you can see it beautifully did some experimental data analysis on my data some information about the distribution of the features that I have in that CSV file that we just uploaded and even created some plots so there's certainly a code got executed to generate this that's how this code interpret is working and there's a python sandbox behind this to prove that I'm going to ask show me the python code you used for this let me fix the typo there you go let's check it out and here we are this is the python code that got generated on backend and it created those plots for me and all the information that we saw as an answer so now it has access to my data it can generate and execute python codes now I want to ask some follow-up questions let's say I'm the the one interested to get some houses listed for example right so I want to see what is the newest listed house in this data set by age so let me ask and here it is it went ahead and figure out the newest data set or house listed by age and it says here's the rest of the information about that particle list listing that is included inside the data set okay so now what I going to do I got to say oh actually I'm very interested in this house so connect me to an agent this is the time I going to check if my calling agent function works or not and as you remember for calling a agent we need to know the age of that house and the number average number of rooms right which are all here so I expect that this llm should know the inputs needed to call my contact agent function and it should understand that here there is a need for calling an agent so let's give it a try here's my question I am interested in this listing connect me to an agent let's check this out there you go it understood that okay this is the time I need to call this function and remember this function has two inputs one is number of bedrooms and AG it also automatically captured those goes from the chat history and now if I have a python code let's say that send an email or or reveal a phone number or something on back end I can do that because the output of my llm can trigger another python code to contact an agent all right so what we did it was in playground right and you might say that mg I want to code this I don't want to come to this UI and do us these stuff right that's correct so because I have saved this assistant I can call this through code and I can even create all the stuff that I did through code as well in order to show you here are some examples that I got from Microsoft link and I'm going to add that to the Discord channel on the reference sections and the Discord Channel link is added to the video description below go there and when you open the Discord Channel there's a reference section on the left so you click on it you will see the link of this notebook here's an example that you want to create an assistant that help manage win turbine far okay so what I going to do I want to upload some files and create some assistants so you simply need to put your credentials connecting to your Azure open and like key end points and then have your client created you need to make sure you have the code interpreter enabled to have that python sandbox to execute the codes and then you this is how you upload your files as I did m in the UI but you do that through code so it is into a folder called data which is here and as you can see the tubine CSV file is here so this part of code we upload that to the assistant and of course you needed instruction for your assistant as we did for housing assistant this is for portolio management assistant some random explanations there and that's it this part of the code will just send the message in case there's a text or image need to get displayed that's how it should work and that part is checking if for example the chat got expired can so it is checking some what ifs and lastly this going to be the one that process the message and send to the API here are some questions that you can ask for example so I didn't run this code just wanted to high level walk through on this is also doable from the code perspective if you're interested to do from code this is I think a good very hell word example of dealing with API assistant in Azure op a and that was all about this video and I hope you enjoyed it thank you to get value of anything you need to sacrifice did you know that the hard thing and the right thing are usually the [Music] same easy doesn't come into a grownup life dream big my friends believe in yourself and take action till next video [Music] the
Info
Channel: MG
Views: 6,133
Rating: undefined out of 5
Keywords: azure openai, ai automation agency, ai automation, custom chatgpt, assistant api, azure ai, ai automation business, ai automation tutorial, azure ai studio, azure ai services, azure ai services tutorial, azure openai service, azure openai api, artificial intelligence news, artificial intelligence, machine learning, machine learning for beginners, Custom AI Assitants, ai assistant python, advanced ai assistant, Azure Open AI Assistants API, ai automation youtube
Id: Zs42ZDRUJnY
Channel Id: undefined
Length: 14min 42sec (882 seconds)
Published: Tue Feb 20 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.