so now that we're connected with openai in our u-jet workspace we can now utilize all of its features the first feature that we want to discuss is the text generation tool so with this text generation a user can basically ask any question towards the chatbot we will send the question towards open Ai and open AI will generate a response for us do note that these questions are not business specific but we do have another feature for this that which we will cover in a later video so first of all let's insert a question block and
from this question block Also let's connect it towards the starting step and then from this question block let's ask a really simple question something like we'll save this inside a custom field called response for now and then the next step will be to pass the question of the user towards open AI itself and the way to do this is by going with an action block inside this action block we're going with Integrations then open AI going to press edit action and from here we can choose the create text completion step so inside this step to
create a text completion you can do it any number of ways inside the prompt but basically what we will do is just first to give openai only the question the user asked so the way to do that you can do that in two ways you can do that by using the custom field that we just used inside the question block or just insert the Lost text input both of those custom fields or system fields in this case will work for now we will go with response and then let's say something like as a test value
to see if openai works properly let's say give me bike tips on a successful Market data you need to spell successful right successful marketing campaign there we go the model by default is text DaVinci 0 0 3 but you can adjust this model to anyone and to any you like DaVinci series 03 is a really good one so I will leave it as default then we have the mixed opens and the max tokens by default is set to 100 but if you find that openai comes up with uncompleted answers uncompleted replies that means that you
will need to increase the token size if you get those unfinished replies then do note to experiment with increasing the maximum token size because the token size will determine the number of characters that openai will generate for you then we also have the temperature and the temperature is by default set to 1 and it controls the randomness so it will lower the result in less random completions as the temperature approaches zero the model will become deterministic and repetitive so if you decrease the temperature you might get the same answers every single time so by default
leave it to one see if that works for you and otherwise you can experiment with the temperature that way same goes with presence penalty so defaults default is set to zero but it depositive values penalize new tokens on whether they appear in the text so far increasing the model's likelihood to talk about new topics so again I will leave it at zero but you can experiment with it if you do not get the best results generated for you then we also have something called frequency penalty and this also defaults to zero but also the values
penalized new tokens based on their existing frequency in the text so far so that means if you increase the frequency penalty that means that the number of words inside of a rope line will become less repetitive because openai will then try to prevent those exact same words being generated over and over again you can also experiment with stop sequences but to be honest I never use them and I did not even need them for now let's try to test the request and see what we get so we ask give me five tips on successful marketing
campaign so let's see what openai can come up with so you will see that the model is text to finches 003 because that's the default and then we have the choices in this case we only created one choice right but we have a text here so one develop a clear a constant message consistent message create a focus message that speaks towards the target audience and then we have number two tip number three tip and here you will see that the text actually cuts off right that means that the default 100 tokens is too little for
openai to generate this kind of response so if we set it to 500 for example then let's test the request again to see if we get a complete result back so this will take just a few seconds and then we'll get the sample data as you can see here and now you will see that we have tip one we have tip two we have tip let's see where is three I'm missing something tip three is here tip four is here and tip five is here with the total text completion so this example alone will also
show you that you sometimes need to increase the max tokens do note that when increasing Max tokens means increasing the characters while also increasing the billing the credits that you have with open AI because open AI is not for free once opening an account you will get some free credits but after that you will need to pay them and so do take note that you have to find a pretty good balance between the max amount of tokens and your usage in that in that regard if we want to save this text however we can just
go and select it you will then see that we get a Json path on the right hand side and we can map this to any kind of a custom field I already have a custom field called openai response so I will save it towards that and once pressing add you will see that it ends up at the below overview we can press save so what we have so far is we asked the question we generated a reply from open AI we saved it towards a custom field and now it's time to display that generation that
text completion towards the user we can easily do that by going with a send message tab inside that send message step let's also do a little bit of typing just to simulate an active conversation right so let's go with typing and then let's say two seconds and then we are going with a text message where we will just respond with openai response a few seconds later so we will give the user some time to read it let's go with another typing delay let's say five seconds instead of typing we are going to use waiting and
inside this waiting after this waiting we are going with another text and let's say if you want to try again press the button below just so we can create a loop of sorts to test it multiple times so let's go and let's say I'm gonna try again and let's connect that towards the question step and then publish this so let's take a look if we can generate a few answers this way let's preview this flow and let's go with a web inside of a pop-up so that should work just fine and let's enlarge it a
little bit and from here what would you like to know uh give me a recipe or an Italian there we go so let's see if openai can come up with a recipe for us so it will generate the response and then after a few seconds you will see the typing inside the chat conversation window and then we should get a specific reply and there we go so this is a pretty big reply as you can see because we set the open AI tokens to Max of 500 you will see that we get a really structured
reply so we have the ingredients we have the instructions on how to prepare the food and with that we have a complete recipe within just seconds so if you have no inspiration what you want to make for dinner today then just ask the chapel and the Chipotle will come up with a recipe for you let's try another example so let's go with something completely different and let's say so we could say something like this generate a tweet about marketing tips and give proper hashtags so if you have no idea what to post on certain social
media like Twitter in this case let's see if openai can help us with that if this is something fitting towards your Niche which is marketing in my case let's see if openai can give me some ideas on what to post so let's say generate and let's see what openai can come up with and there we go Marketing in the modern world starts with a good content create useful and unique resources that appeal to your target audience hashtag marketing tips hashtag content strategy hashtag small business now this is definitely a tweet that I can use inside
of my Trader account because it's really relevant towards my specific Niche which I am in I'm in the education of marketing content so this is fantastic for me to if I have no inspiration whatsoever I can just go inside of my checkpot and interact with Chipotle to ask for some additional content in the next video we're going to show you another feature of our native integration which is image Generations