wmpKpoK-alc β
Let's learn how to use OpenAI Agent Builder
Transcript β
[00:00] Let's learn everything we need to know about the new Open AI agent builder as if you're a complete beginner as fast as possible. Welcome back y'all. In today's video, I'm going to show you all the fundamental tools in this agent builder, understanding how to use these tools because what I've realized while playing around with it is that it's a little bit developer focused. But don't worry, I'm going to make it sound very easy, almost like you're going to McDonald's and ordering your favorite Happy Meal. Okay, sound good? Let's do it. First major puzzle piece, the agent builder up here. This is found in your OpenAI developer
[00:30] account. If you don't have one, I'll leave it in the description down below. Just simply click it, create an account for free, and you'll be able to start creating your workflow. The second major fundamental part of an agent workflow is going to be chat kit. We will dive into more complex tutorials about this, so make sure to subscribe and check out the playlist I'll leave in the description down below. This is going to be a multi-part series where I show you how to do everything with this new toolkit. All chat kit is is it allows us to take the workflows we create here and easily embed it into our website or software. Which leads to the third major tool that
[01:00] you should care about within this workflow, which is going to be widgets. Widgets are super cool. Widgets are going to be how the UI looks when a chatbot is a response. So, now that you understand fundamentally what makes an agent, let's create a workflow. So, you're going to be thrown into a drag and drop UI. Now, one thing I want to make very clear, y'all, very clear. Even though this looks drag and drop like, "Oh, Corbin, this should be really easy." This is developer heavy. So, that's partly why you're probably watching this video because you're going to have to use a little bit more code syntax than you would just like, "Oh,
[01:31] this is a Zapier video. Let me just drag a block and do an action." It's going to require a little bit more understanding of what's actually happening. So, don't get frustrated. When I was using this tool, I was like, "Whoa, okay, this is more developer focused than I was assuming it was going to be." So right off the bat, all you need to understand is this. In order to initiate all workflows, it's a chat. Eg. I come up here to preview. I just say something like hello. And this begins the workflow. As of now, that's the only trigger. Next, let's do a quick dive of what all these different items are over
[02:02] here. First off, agent. I want you to think of agent simply as the AI we integrate into our workflow. So this encompasses the underlying prompts, the model we will use, the reasoning effort and relative tools that already integrate natively within the workflow such as web search, file search, MCP server. There's a caveat there which I'll get into. Code interpreter and things we've seen in the past when it comes to OpenAI. Agents are going to be essentially the fundamental laying bricks for all workflows because without agents, none of this really matters.
[02:33] That's the AI. That's that's why we like this. That's the AI. Okay, agents out of the way. End. Basically, this is like, hey, we started the workflow. End is going to stop the agent and stop that workflow ID. What I want you to understand is that when a workflow starts, in theory, you could find yourself and create workflows that loop. Eg, if there's information put into this workflow data, we can keep talking to the chat in that context. But maybe in some workflows, you want it to just end abruptly. For example, maybe the end conversion point is just giving you the
[03:04] weather. Okay, just end it. We don't need to keep going here. notes. Pretty self-explanatory. This is like comments in code. You could just say hello here. I could put anything. I could put I love coffee and it will not affect the underlying workflow. File search. This allows the AI model to call and reference relative files you store in your vector database. Now, your first question might be is Corbin, can this handle PDFs? It actually can. For some reason, though, when calling it within a workflow, it goes through vector stores. So, keep that in mind. Typically, when dealing with vectors though, the file type would be ajson. For now though,
[03:36] what you need to understand about file search is that you can do PDFs. Guard rails. Important to know, important to understand. This is going to be preset things that we can add into a workflow to make sure things like moderation can occur. This is like an if else statement, but it's already laser tuned for you. For example, I hit the gear icon. Don't talk about hate within this workflow. Don't output that. None of that. Don't leave no hate comments, okay? And this will stop the workflow. MCP. MCP is going to allow you to integrate with a bunch of different apps. This is going to require a
[04:06] separate video, so stay tuned to this channel as this gets a little bit more complex to the extent that I played around with it. And I was like, "Oh my gosh, I can't believe OpenAI really went this developer focused where yes, if you are trying to tackle MCP right now, it's extremely confusing." Don't worry, I'm going to make a very simple video on how to use it. If else uh this is a classic from any development essentially if the person likes bacon based off this bullying. What does bullying mean Corbin? True or false? Then do XYZ. We're going to set this up in our flow today. So don't worry. This right here is something we do in software called a
[04:38] loop. They call it a while. This does is that we can essentially repeatedly do an action for X amount of times. Now to be clear in software development when you run loops it's actually a pretty high-risisk thing unless you really know what you're doing because end of the day you don't want to run a cloud function that is an infinite loop because it cost you money cost you credits. So keep that in mind for now though we don't have to care about that user approval pretty self-explanatory. This is like an if else statement again but it's simply hey can I do this right now? And if it approves go this way if you disapprove
[05:08] go this way. Transform is fundamentally one of the most important blocks when I was playing around with this. This is going to allow us to transform the data going in and out so it's readable and legible by the next block. And finally, set state here. This is when we do a trigger. We shoot off. We say, "Hello, how was your day, chatbot?" We start the flow and we want to save relevant data here that we could reference later in the flow. Now, if that was a lot and you're watching me right now and you're like, "Dang, this guy Corbin, he sucks at teaching." Let me just give you the
[05:39] overview. Now, let's jump into building out a workflow. Because to be honest with y'all, we're going to have to do a ton of videos on this. So, make sure to stay tuned on that playlist. Start. Agent, what are we going to do today, Corbin? Let me just show you simply how we can set up some if else logic. In addition to this if else logic, let me show you how we can set up variables within an agent workflow. Here is the purpose of this agent. And here is something that's going to switch your brain when it comes to an agent and what it means in a workflow. We can simply make this agent be an identifier for a bully. And a bullying is true or false.
[06:10] I'm going to rename this agent is web search. Then I'm going to identify in the instructions if user message requires the internet set is web to true. I'm going to come down to output format here. I'm going to choose JSON. All you got to understand when I say JSON, this is just a coding language. English, French, German. Do you don't worry about it. This is just how the AI reads the code coming in and allows us to format the code. We're going to say what is going to be is web search. What does this mean, Corbin? I'm just going to say web search here for the name so I
[06:41] know what it means later on. I'll put is in front as well. We're going to add for the property name. This is how we reference it and how we'll see it later in the workflow. So I can just do is web for this type. We have string number bool enum object array. Corbin, what do all these mean? Don't worry about it right now. All I want you to do is set up this first workflow with me. Hit bull. Bull means true or false. Update. Now before I absolutely get spam the comments here, Corbin, what are you doing? Like all you have to do is go to tool here and simply hit web search just just just the process. Okay, watch
[07:12] what's about to happen. So therefore once we do that we're going to connect it. We're going to grab this little string thing the string bean. I'm going to put it here in this if else we are going to essentially say if is web and then we're going to use these double equals equals true. Nice. So what does this mean? This means that if this initial agent that receives a message receives a message that requires internet search, it's going to set that boolean to true. And then if that boolean is true, then we're going to simply do X. Or if it's not, we're going
[07:44] to do Y. Now, let me preview this so it makes a little bit more sense because I sound like a crazy robot. XY XYZ 1 2 3. Preview. I'm going to put in a message that requires web search. I'm going to say, what is the weather in SF right now? Enter. When I hit enter, it starts. the agent is running. This agent's sole purpose is purely to determine whether or not this requires internet or not. If it requires internet, it's going to set it to true. And therefore, if it's true, then we'll do the next step here. If you run a task and you're like, Corbin, what
[08:14] the heck just happened? It stopped early. There was an error. Come up here to evaluate. This is your version of like an error log, a console log. If you're a developer, you know what I'm talking about here. Essentially, this is going to be like the workflow started. This is how long it took. Here is the response. So look at this. I say system instruction user requires the internet set is web to true user. What is the weather in SF right now? And then it's like hm determine weather data needs. I need the current weather in San Francisco which requires internet access.
[08:44] Good job AI. So then the output was only is web true. Perfect. That is the only output we're going to read in the next step. What's the next step Corbin? The next step was this one. And how do we know which one is it? Because simply we click here. We make sure we choose the boolean. And then we make sure we do equals true. All you need to understand is that if the web search is true, it needs web search. It's going to go down this path. And then in code typically if that the data coming in is anything but
[09:16] true, it's going to do an else here and then do this path. Also code can get more complex. We can add more versions of this. We can do else if else if else if. So maybe it's not true, maybe it's something else. But the idea here for now, all you need to understand is true or false. So if it's true, I'm going to connect a new agent here. I'll go ahead and give the tools of web search. So you just learned something else here. If you want the agent to have a capability, tools web search, we can set up parameters here. I'm going to just say add for now. I'm going to go ahead and put do the requested message. And this
[09:46] is the message. I simply hit add context input as text. If you're like Corin, where the heck did you get that? Don't worry about it. It's coming from here. This was the original text. I inputed my little message in the little chatbot. And just to prove to you that it works, we're going to do another agent here. So, I'm click agent again. And we're going to say coffee joke. And its objective is simply going to be say a coffee joke. Therefore, when I'm testing this and I'm showing you this, I'm going to do both routes, true and false, so you can see it working. Now, I'm getting an error here, but I don't trust OpenAI telling me this is an air cuz I don't think it's an error. Therefore, let's go
[10:18] through the first path here. if we require web search. And I just realized because the idea is a little bit more broader than just weather. We'll just say like internet search for this one. Boom. I like it. So I'm going to go ahead and say what is a weatherf today. Hit enter. It's going to first do that boolean true or false is web. It should set it to true. There we go. And it went right here. Look at this. If else actually worked here. So since it knows it needs web search, it's going to this agent instead of this agent. So therefore, we should get an answer here for San Francisco, California weather. And boom, that is the date today. Now,
[10:50] you might be like, Corbin, I don't believe you. I don't believe that if else works. Okay, then watch this. What is the capital of Texas? This shouldn't require internet search. Therefore, we're going to get a coffee joke. Boom. Austin. I guess it went quite direct here, though. All right, so fair enough. I guess it wanted to go quite direct there. It ignored the coffee joke, but you get the idea. It went to false because it knew it didn't require internet search when doing what is a capital Texas. Okay, not bad. Let's go to integrate a widget into this workflow so you can kind of see how that looks.
[11:21] Now, this is a little crazy, y'all. I am not going to lie to y'all. This is beta and part of you might be like, Corbin, why did you say earlier like you don't even believe believe OpenAI in this air and it still worked? Because this is beta and you're going to get errors that you shouldn't get because this is prototype stage or beta, maybe not all the way prototype. Saying that, and this is what happened with GBTs in the early stages. If you remember my GBT videos, there were errors that people were receiving. you shouldn't have received them. You did nothing wrong. It was Open AI's fault. Like that's a real thing,
[11:51] y'all. Saying all that, let me clarify something about widgets here. Well, first off, let me show it working. So, instead of text, I'm going to do widget. I'm going to add widget, and we need to go ahead and upload one. First off, let's just say create here. What widgets do is that instead of you getting a text output provided by the agent, you're going to get nice little user interfaces that you can use. Now, the one I'm going to choose today is just going to be this weather one here. Another way you can create your own widget is using their app builder here. Now, this is another
[12:21] reason I'm going to have to make a whole separate video on this. So, make sure to subscribe because creating a widget in this UI, it works up to 90%. But you're going to run into very annoying errors and you're going to start asking yourself questions like, "Wow, maybe I'm just not meant for this." No, no, no. I'm telling you right now, let me just show you the right way to do it. Beyond that though, let's just show you like a very simple use case here, right? So, I'm going to come down to weather. I'm going to simply download this. So, I'm going to say open in widget editor. Download. So, with that done, we'll come back over here to JSON widget again. We're going to hit upload. It's going to
[12:52] take you to your desktop. It's going to be a dot widget. Don't worry about it. Add it. What is fundamentally important for you to understand though is this constrains this AI agent's outputs to just that widget format. Therefore, if any other type of output incurs, it's going to break. Capoot. That's Deutsch for broken. But the idea here is that then that means when creating these workflows, you're going to have to get quite traditional on the different types of agents and the different types of widgets you want to output. I might be speaking crazy to y'all, but let me first just show you this working and then breaking. What is the weather in SF
[13:23] today? There we go. It still broke a little. There's supposed to be an image here, but you get the idea. This is the UI. Now, let me show you it breaking just completely because it's like, wait, I'm expecting a specific type of output. New chat. Look up best ways to cook chicken. I'm assuming because I said look up it will know to do web search. And while we let that generate, make sure to check out my school community here. It is completely free to join. Think of it like a Reddit forum. Post business ideas, issues you run into, and we will help each other out. Description down below the link that says join my community free. So there you go. I
[13:55] wanted to know how to cook chicken. And then as you can see, this entire UI just absolutely breaks. Therefore, that makes you understand that this is very granularized in the sense that if you say this is a widget output, eg you go to your agent and you say the output format is only weather current and that's it. You can't do text, you can't do JSON. Therefore, we can make more complex workflows that can accommodate for this. But for now, understand that last couple things here. If you're like Corbin, I'm ready to go. Let's do it. Come over here to publish. I'm going to call it we building because we building
[14:25] published. The next thing it's going to prompt you to do is going to be this workflow ID, current version, chatkit. This situation going to be a separate video. So, make sure you subscribe here. I'm going to dive really deep into this. You might be asking yourself, Corbin, how deep? We're going so deep that I'm going to create an entire code repository in GitHub. I'm going to open source it and let you have a starter template that you could use so you can actually see the functionality of what the heck a chat kit is and how that works. I'll build off cursor AI. It'll be very simple. I'm going to show you how to integrate a third-party API into
[14:56] it. There's going to be a lot of it's going to be a lot of fun. Okay? So, just stay tuned. That chat kit is how we take workflows like this and basically put them into our applications or our websites or our softwares that we have in our company or just you're having fun, you want to build something. So, there we go. Let me know in the comments what you want me to prioritize next with these AI agent builders. Because to be honest with you, I'm on a schedule where I post one video a day, but even then, I've already wrote out like six videos I need to do just on this topic alone. Don't worry, the Zap year integrations
[15:27] coming soon. The MCP integration is coming soon. Stuff like this is coming, but let me know in the comments which one you want to see first and I'll prioritize that. Also, another really big thing about this channel is I stream every single day. So, check out the Twitch down in the description down below between 5:30 p.m. PST, 7:00 p.m. PST. I'm going to be jumping on. We talk about stuff that's happening in AI, reacting to really funny stuff. y'all make in the community and everything we love. Check it. So, that's it. Those are two random videos. That is my face. And as you already know, I'll see you in the next. Did this open AAI agent builder
[15:57] just destroy half a million startups?