How to Use OpenAI Assistant API | New OpenAI Assistant API Tutorial | Connect with Pabbly Connect

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to P connect so today we are going to discuss the latest feature the latest update shared by open so open aai has recently launched their assistants API using this feature using this assistants API you can basically create an assistant-based API bot in your open a account and you can connect that bot with any platform any applications of your choice now here this assistance API update is now available inside P connect as well and today we are going to see how you can use this open AI assistant API inside P connect so as you can see on my screen here I have just created a simple workflow where I have selected telegram bot as a trigger application and basically I have connected my telegram bot with P connect and captured a response a message which I have sent to my telegram bot then after that here you will see once I have received this message I want to send the message which I'm sending which the user is sending to my telegram bot I want to send this message to the AI assistant which I'm going to create in my open AI account so before doing that let's create an assistant in our openai account so we will go to openai and here from the left sidebar here you can see the section of assistants just click on it here you can see right now I have two assistants in my open account to create a new one just click on this create button and give this assistant a name for example I would like to name it as PC AI test this is the name which I want to give you can basically give any name of your choice then after that it is asking us for the instruction that what is the instruction you want to give to this AI assistant so let's say I want to give this assistant an instruction like okay so this is the instruction which I have wanted to give to this AI assistant which we are creating after mentioning entering the instructions the next thing it ask us is the model and here in this drop down you can see a list of all the models offered by open AI so out of all of this which particular AI model you want to use you have to select that let's say I want to use GTP 41106 preview I want to use this model for these threads this API assistant which we are creating so I have selected that then after that you have an option to add some functions do you want this code interpreter tool with this AI assistant or not you can select that like let's say I don't want a code interpreter over here in this assistant that's why we have turned this off and also we have this retrieval option what is this retrieval retriever enables the assistant with knowledge from files that you or your users upload once a file is uploaded the assistant automatically decides when to retrieve content based on user requests so let's say you or your users who are communicating with this AI assistant bot which we will be creating are sharing some files so here if you select this option if you enable this option then after that this bot this assistant AI assistant which we are creating in our open AI we'll decide whether to get the content from that particular files or not so let's say I want to use this retrieval function so I have enabled it now if you want to upload or add any kind of file over here you can do that but right now we are not going to upload any file over here and then let's click on this save button now as we click on Save here you can see just now we have created an assistant inside our open AI account now after creating the assistant what we have to do we have to basically create a thread and under that particular thread all the conversations is going to happen with this AI assistant which we are going to create now you must be thinking how you can basically create a thread so to create a thread we will go to this playground section from here and after coming to the playground here you can see in this option about clicking here we will see a list of all the assistants which we have created out of all of this we have to select the assistant which we want to use so just now we have created this PCI test this particular assistant so let's select this assistant over here then after selecting the assistant the instruction the model and all of these options are selected by default now after this what we have to do we have to start this thread by sending some kind of message or some kind of information so let me send some kind of data has some kind of information related to some topic for which we are creating this AI assistant so I have already copied some information related to public connect let's say I want to create this AI assistant for public connect so I've entered the details some information related to that and we will just click on this add and run now when we click on this add and run button here you can see if you click on this logs button on the right side you can see all the logs over here and under these logs you can see all the information which is happening right now so here here you can see this cancel run button if you see this option this mean it is processing this data and after processing the data it has not changed to this run button so right now what has happened we have basically sent some kind of data some kind of content to this AI assistant over here in this right and in response to that this PC AI test this particular assistant has basically sent us some response so basically we have sented the data and it has processed the data and sent us this response now after doing this here you can see on the stop section you can see this thread ID so this is a unique thread ID which we will be using in our automation workflow as well so here in this thread you can see all the question all the things which you want to ask related to public connect you can ask in this thread let's say I want to know something like what is a workflow I have asked this question after giving the information related to P connect I'm asking it what is a workflow and here after after sending this message it is going to process this message and then it is going to give me a response related to that so let's wait for the response over here and we have received the response so here you can see this assistant told us a workflow in the context of public connect and similar automation platform is a series of automated action that are triggered by a specific event essentially it is a predefined set of tasks that are performed without manual intervention so it is somewhat correct for the information which we have given so in this way this complete thread is going to work and using the use case using public connect in this video we are just connecting This Thread with our telegram bot which we have created this means I will be sending some questions or the users will be sending some questions related to P connect to this telegram bot and then in response to that using open a assistant it is going to basically get the response from here and then it will show the response back to me so this is the kind of automation workflow we can create now now in this video we are just discussing this use case as an example but basically you can use this open Assistant API for any use case or with any applications of your choice so let's see how you can use this assistant API inside P connect how you can use this thread which we have created inside P connect and automate the task related to that so first of all we'll just come to our action window after setting up the trigger and here in action we are going to search for open AI just select it after selecting open AI an action event in the dropdown here you can see a list of different action event out of which there are some action events like for example create assistant so the assistant which we have created just now this you can actually use or automate the process of creating this assistant as well then the next action event that we have related to assistant API is create thread so just now we have created this thread over here in our open a account but if you want using this action you can create the thread then we have this create message create run and retrieve message and these are the three actions which we are going to use in this video first what we have to do after creating This Thread we have to create a message so we have selected this create message action event then just click on connect and select add new connection over here now here what we have to do we have to enter the API key of our open AI account so we have to connect our open a account with public connect and for that we have to enter the API key now to get the API key we will get back to our open a account and from the left side bar we will go to this API key section after coming here let's click on this create new secret key and let me give this key a name for example I'll name it as P connect you can give any name of your choice and click on create secret key now as we click on it here you can see the API key of our open a account just copy this key from here go to public connect and paste it over here and after pasting this just click on Save and as we click on Save we will see our open AI account will get connected with P connect after making this connection this action event of create message it basically ask us the first thing and that is the thread ID that in which particular thread in our open a account we want to create a message so we have basically created this thread with some information and we want that all the messages which we are sending in this automation workflow should be sent to this particular thread only we are building the automation for this particular use case so we have to basically copy the thread ID from here as well so just copy it from here or you can copy the thread ID from the URL section and then paste it over here so in this Fe we are telling this action step that we want to create a message for this particular thread after it it is asking us for the rule so in roll we have currently only one option of user so we are going to select user and then it is asking us for for the content that what is the content what is the message which we want to send to this thread so we have basically received the message we are basically receiving the question or content from telegram so here we are going to map the message received from telegram bot in content section because that is the response that is the question or the message we want to send to this thread so from the drop- down from telegram responses we are just going to select the response of the message which we have received and as I told you we just taking an example of telegram in inad of this you can use webook or any other application any other platform of your choice then it is asking us for the file ID so if you're using some files in your thread or you want to add some kind of files you can select the files from here as well right now we are not using any files in this AI assistant API which we are creating so we can just ignore this field for now and then just click on Save and send test request now when we click on Sav and test request here you can see it has basically created this thread message so in this particular thread it has basically created this message which we have entered in content section but this is not the last step after creating this message what we have to do we have to basically run this message as well so here you can see we have two options over here add and run and we have ADD so right now we have just added a message we want to run this message as well for that we are going to add another action step of open a so we will just scroll down click on this add action step button over here and then in choose Zab once again search for open Ai and this time in action event from the drop down we are going to select the action event as create run so first we have created a message now we are going to create a run over here we are going to run that message through the thread then just click on connect now because we have connected our open a account in the previous step we don't have to make a new connection you can select the existing connection and click on Save after clicking on Save the first thing one second it asks us is the thread ID that in which particular thread we want to run a message so here we have received the response of thread ID in the response of previous step after creating the message like here we have manually pasted the thread ID but after creating the message in the response you can see we have received a thread ID that in which particular thread this message is created so we can basically map the response of this thread ID so from the drop down from create message responses select the response of thread ID and map it then it is asking us assistant ID so it is most likely possible that in your open a account you might have created multiple assistants over here so which particular assistant you want to use in this thre so in this drop down you will see a list of all the assistants which you have created and you can select the assistant of your choice let's say we have created this assistant of pcii test and we want to use it so we have selected that then after that it is asking us for the model so using which model you want to basically run this message so once again it is asking us this option let's say I want to use GTP po model over here the best one right now so we have selected that then it is asking us for the instruction so while creating this assistant We have basically entered some instruction but if you want you can enter the instructions over here as well and these instruction entered over here will override the default instructions which we have given over here but right now we don't want to give any new instructions to this particular assistant and that's why we can keep this field blank and in tool type from the drop down we have two option code interpreter or retrieval so if you want you can change the option change the setting from here to but right now we don't want to make any changes so we can just ignore these two fields and click on Save and send test request after clicking on C send test request here you can see we have received the response and in this response you can see the message which we have created or the message which we have sent to this thread in the previous step that particular message is run and then here you can see the status of this message right now is skewed this means the thread or the assistant API or the assistant which we have created over here it is right now processing this message in the thread which we have created now it can basically take up to 90 60 to 90 second to process this message so what we are going to do we are going to add a delete before we get the response of this particular bot or this particular message we are going to add a delay of for example approximately 2 minutes so just click on this add action step button over here and then here in choose app search for delay just select delay over here after selecting delay here it is asking us how much delay you want to put in workflow so here from the drop down we are going to select delay for in units we have selected minutes and in delay value we are going to enter two and just click on this save and send test request button in this way we have added a delay of 2 minutes in our automation workflow so after sending this message after running this message what we have done we have basically added a delay of 2 minutes and after 2 minutes what we have to do we have to basically use another action of open AI so I will just copy the step from here the previous step which we have created and I will paste it below this delay step after delay what we have to do we have have to basically run the action event of retrieve message so just now what we have done first we have created the message then we have created a run for that message now what we are going to do we are going to retrieve the message so just select this retrieve message action event click on connect and then select the existing connection and once again connect your open EI account after connecting it this time the only thing it ask us is the thread ID and here in the thread ID from the previous step of create run we are going to to map this response of thread ID and after mapping it just click on Save and send test request now when we click on Save and send test request here you can see we have received the response and in this response you will see the response of this assistant which we have created an openi for the message which we have sent so from telegram we have received a message over here that was what is probably connect and for this particular message the thread the assistant which we have created over here it has given us some answer some message some response and this is the response over here here you can see this data zero content zero text value here you can see the response public connect is an online automation tool that help user connect and integrate various applications and services to automate complex workflows and here you can see all the other answers the complete long answer as well so in this way what we have done we have basically created an assistant inside openi and we have basically generated a response from that assistant for the m message which we have sent on our telegram account or our telegram chat now after this what we want to do we want to basically send the response send this answer or message given by openi back to our telegram chat for that we will just scroll down click on this add action step button and we are going to add the telegram step so we are going to select telegram bot as the action application and after that in action event from the dropdown select send a text message or reply then just click on connect and because we have connected our telegram bot in the trigger that's why here we don't have to make a new connection if you need any help connecting your telegram account telegram bot inside P connect we already have a lot of videos on live on the channel so you can refer to those videos as well and then just click on Save now when we click on Save we will see what telegram board the same telegram board which we have connected in trigger is now connected in action after making the connection it is asking us chat ID and text message so in chat ID we have to mention the chat that in which particular chat in this telegram account we want to send the message so here you can see in the trigger response when we have received the message from telegram bot over here we have received a response of chat ID and we want to response to this same chat so we are going to map the response of chat ID from trigger in this action step of telegram as well so from the trigger responses select and map the chat ID and here in text message we want to give the message we want to mention or send the message given by openi so here from the drop down we are going to map the response received in this retrieve message action over here after mapping both of these details all of these fields are optional so we can just ignore these fields for now and click on Save and send test request and when we click on Save and send test request we will see we are basically sending a message on our telegram chat so we will go to a telegram account and here you can see to this spot we have basically asked this question of what is probably connect and it has basically sent the same question to open AI assistant API and using this using this content using this thread it has basically generated a response too and after generating this response here you will see we have basically send the response back to the same bot in Telegram and for this particular use case we have simply created this whole automation workflow now after creating the workflow let's ask this bot another question let's say I want to ask is what what are the features of public connect so let's ask this question to this bot so we have basically sent the question to this telegram bot now because we have added a delay of 2 minute in our automation workflow we will see within 2 minutes we will get the response for this particular message from open so using this automation the telegram B message will be sent to openis assistant API which we have created and then after that the response will be received from this API this assistant over here in open aai and then we are going to send that response back to telegram bot we will check the history of this automation workflow and we will see the automation workflow is triggered and it is now on the delay step so after completing the delay of 2 minutes it will be sending the response given by openi to our telegram bot as well so let's wait for 2 minutes over here and yes after 2 minutes here you can see we have sent this question that what are the features of public connect and exactly after 2 minutes like at 1726 we send the question and at 1728 we have received the answer by the seam bot automatically without any manual effort so the answer is pic offers a robust set of feature designed to automate task and integrate various applications seamlessly and here you can see all of the features given by the open a so basically we have created an assistant inside openai and and using B connect we have connected that assistant with other platform with other app like telegram over here so this was the complete section complete use case of open ai's Assistant API for this particular video but assistant API has a lot more functionality and use cases which we will be covering in the coming videos on this channel so stay tuned and now as you know that how you can connect assistants API inside public connect you can basically connect assistant API open as assistant API with any platform any applications of your choice and create the automation workflows for yourself and for your business also if you want you can share the automation workflows with public connect team or public connect Facebook Community as well so this is it for today's video thank you have a great day
Info
Channel: Pabbly
Views: 2,204
Rating: undefined out of 5
Keywords: openai api, openai pabbly, openai pabbly integrations, openai assistant api pabbly connect, how to use openai assistant api, ai integration, ai automation, ai-powered workflows, openai assistant api tutorial, how to use openai assistant api inside pabbly connect, openai assistant api, openai assistant, openai assistant creation, openai assistant playground, openai home assistant, openai google assistant, latest video openai assistant, open ai assistant api use
Id: 7p_PvQTSIpY
Channel Id: undefined
Length: 21min 46sec (1306 seconds)
Published: Wed Nov 08 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.