So we're coming close to the end, and you're going to miss me, but you might not miss this kitchen metaphor, but I hope it works for you because everybody wants to be a chef. You're an AI chef. Are you feeling it? Okay? Good. Keep coming with me. So, what we're going to do in this section is to do something really hard. We're going to imagine a world where you just say I'm hungry and the LLM is able to complete that meal, use the plugins you've created and voila. You didn't have to do anything at all. You just kind of wished it. Let's jump into how that works. It's pretty amazing. Think of the small business owner. I like the two buckets, the bucket of time is leaking, the bucket of money is leaking. You know, do they have time to think about how to solve their business problems? Heck no. you have the tools to be able to give them interesting solutions, but at the same time, if they could just say, I wish I could do X and just have the AI help the business owner with as little effort as possible. For instance, let's say that the wish were something like, I wish I was $10 richer. I will need to blank. You know about the completion engine now, right? It'll complete it, but it's going to hallucinate because it's making stuff up. What do you do? use retrieval augmented generation to kind of find similar things from your knowledge base. And then you might have different things that plugins could do like write marketing copy or sending email. You can make plugins that do all kind of things, native or semantic. And once you do that, what happens is each plugin will have a description of some form, and all you have to do is use that SIMILARITY engine to find the different tools in your tool bucket. Pause for a second. Anybody who has like a drawer full of kitchen tools knows that it's hard to find the whatchamacallit, but what if the AI can just say, I need something that opens cans, and then voila, the tool appears. That's what happens. So when you have the SIMILARITY engine, you can magnetize all your plugins. If you have 2,000 plugins, you as a human do not want to like use every plugin yourself. You want the AI to find the right plugin. So, uh the third step would be finding the relevant plugins and then use those to be used in the COMPLETION response. That's kind of abstract. Remember, that a plugin, pull out the similar ones, use it for COMPLETION. push them to the kernel. And when you have this thing called a planner, the planner does that for you. And luckily inside a kernel, we love plugins, and now you're learning that we love planners. Because if you got a lot of plugins, you'll need a planner. So, let's do our quick inventory exercise, which you know I like. Wes Anderson fan. Okay, so we did design thinking and then you just did a lot of good stuff. You were able to use the similarity engine to your heart's content. Wow. Doesn't it feel good? You look so good. Okay, that's you. Now, we're going to go into this notebook, which is the big one. Woo. First off, let's make a Kernel, shall we? Let's make a Kernel. This is the, you know how much I like the fire. is what it feels like because it basically is, you know, some GPUs, NPUs. Let's make a kernel one more time. You're going to miss me, uh, because we're not going to make kernels together. But, you know, with making kernels like, you know, I mean, it's okay. Let's just keep making kernels together. We can imagine we're still making kernels together. You're doing great by the way. So, you know, uh, it's not easy what you're doing. Okay, we just made the kernel. We ran it. You know how much uh, you know how much I like the print message. You know, I'm pretty old school. print and I I did it boss. Nothing like, you know, nothing like your co-pilot calling you boss, feel a little superior. Nice job AI. When I set up a computational engine. Okay, next up what we're going to do is remember the, let's take notes here for a second. Uh, we want to have a vat of plugins and then find the right plugin to fit the goal. Right? So how do we do that? Well, there's different kinds of planners, remember the planners? Different kind of planners and the reality is there is a super simple planner that people kind of make fun of. It's called the ActionPlanner. I admit that I had some kind of prejudice with ActionPlanner and didn't fully appreciate it, but now I do because the ActionPlanner is just not that smart. An ActionPlanner, you create it, from the kernel. You give it a bunch of skills, plugins, sorry. I've this if you notice Semantic Kernel has like this like a the complex or the skills, but just call them plugins, work with me here. It's going to shift over to that. But what I'm doing right now is I'm adding the tools for the kernel to do math, to read files, to tell the time. and to play with text. Okay, so basically, I didn't really do much besides add those tools into essentially a vat of plugins like I promised. And next up, let's um, let's do the thing that most people say. I was watching this I was listening to a podcast where people were shading uh GPT-4, saying like, oh well, you know, GPT-4 is really stupid because it can't add. Well, I mean like, I couldn't add when I was a kid basically so let's get over that, right? I mean if you gave it the tool to add, if you give people a calculator, what happens? They start calculating, right? So, we're going to get it to do math. And what we're going to do is we're going to um use the planner to create a one, mind you, a one function, single function that's going to be pulled out of the vat of plugins to use. And what it's doing is it's taking this ask and this is basically looking through all the available plugins it has available to it, skills, functions, etc. Okay. And what I'm going to do is I'm going to ask it to tell me what that function is, right? Let's add some more print statements on around this because you know programming is pretty abstract unless it tells you what you're doing. So, let's run this. And it so it's finding the most similar function available to get that done. What did it do? Wow, it knew that if I'm trying to get the sum of two numbers It found in the math plugin, the addition function. How did it find it? Well, remember we made a description for each function. It's just comparing this question to the function description. Not a surprise, is it? Like, let's say like a, what is today? It's going to look through the available plugins and it found in the time plugin, the today function. Do you see how that's working? It, you know, if you told it to do something very complex like, uh, Um, what is the way to get to San Jose when the traffic is really bad. Now, this might require many plugins to work in concert, but as you can see, it's like, nah, I really can't do that, boss, you know? So, for simple things, uh, how do I write the word text to a file? It's probably going to find in the FileIOSkill, it found the write function. Pretty cool, right? Again, it's very limited. It's no insult to you, uh computer, it's just not that smart. Um, but when when you can do that, um, a simple planner You can imagine a planner that is much more powerful. And so the ActionPlanner is good for like a very basic searching through, find just one function. But what if I wanted to do a multi-step plan that's automatically generated? Right? Let's do that. So what we're going to do is we're going to pull in the SequentialPlanner. is our gen 2 planner. There's a gen 3 planner that is It's been ported from C# so it'll be coming in the repo shortly. Again, this is all open source, so you can get access to the latest and greatest as it comes out fresh out of our kitchens to go into your kitchen. And all I'm going to do is I'm going to bring in the LiterateFriend plugin that I have. The LiterateFriend plugin uh has a few functions. One, it can write poetry, it can translate, but I'm going to hold on to that. Look at that. I'm so like... writer_plugin. And then what I'm going to do is I'm going to make a SequentialPlanner. Remember before I made an ActionPlanner, which wasn't too smart. Let's do a SequentialPlanner. Ooh, it is... I would say like, not just a little, quite a lot smarter. Um, I want it to do the following. Tomorrow is Valentine's Day. I need to come up with a poem. Translate the poem to French. And so this is essentially going to require two plugins, um, essentially one that can write a poem and the other that can translate. And I'm going to do I'm going to call the planner. Oops, I forgot to close the string. That's why it's red, right? Okay, there we go. All set. Good. All right, so I'm going to create plan async, you know, we're we're we're built we're architected in C# where people ask why is there await and like async everywhere, you know, this is enterprise software, people expect stuff. So I apologize but in the end you will thank us for all of our um attention to things that can happen asynchronously because we live in a network world, right? Okay, so that's going to do that. And uh let's basically, let's let's print out the plan steps. I have that over here in my uh boilerplate form. So let's see what happens. I'm going to bring in the LiterateFriend plugin. It's got three functions. Uh one is able to write a poem, one is able to translate, I think the other one is to summarize something, but there's three of them in there. I'm going to ask it to make a plan to address this ask. And let's see what happens. So if things work out the way we want, it's going to realize that I need to write a poem and I need to translate it. And so it pulled out two functions to use. And you're like, well, great, well can you use them? Absolutely. So what I want to do is see what happens. when I have it actually uh tell me what it created. And it says, Tomorrow's Valentine's Day, I need to come up with a poem. That's my ask. It made a poem and then it translated to French. Now, let's do that in super slow motion, shall we? Let's print out the results step by step. That's quite uh beautiful. There we here. Okay. So I have a little trace results, a little you can look at the code later, but uh I'm going to step through the plan and look at different things inside it and look at the input variables and output variables as they change. That is the weirdest part. So I'm going to run that. And what you'll be able to see is that as the kernel takes the plan, the plan has already built a way to take the output from one and stuff it into the input of another. Now watch this move here. The poem's been created. and the poem's been created and it's figured out to add a parameter French. Wow, isn't that amazing? So it basically plucked out the fact that I needed to make it in French and it took the poem output and there you have it. That is an automatically generated thing. Now, you may not think this is a big deal, but it's kind of a big deal because I did not have to tell the system to use those two plugins. I just gave it a box of plugins and it just went and pulled out the ones it needed. And number two, it created a plan, a multi-step plan to effect a more complex outcome. And, wait for it. How does this work? Don't forget your magical piece of, oops. Don't forget. Let's see here. Markdown. Don't forget that there's two dimensions. There is COMPLETION, the COMPLETION is generating the plan, SIMILARITY is pulling in context for the COMPLETION to be more right, and it's also pulling out the right plugins through the descriptions to be able to execute a plan. And what does this mean? It means that in the future you won't go into the kitchen and make dish one, dish two, dish three. You'll just say, I'm hungry, and it'll make you maybe five dishes if it has the right ingredients to do that. It'll make it the ones that you want because it's doing completion, it has similarity, understands what you have done in the past, and it can find the tools in the kitchen to go ahead and cook that. And also the ingredients, too. Okay, so that was a lot covered in a short amount of time. You must be exhausted by now, but, you know, I encourage you to play around with the different parameters here. add more functions. you know, now that you know about the um packaged format of uh functions, semantic functions, go ahead and throw in some native functions, which are by nature deterministic. be sure to label all the variables, label all the descriptions because as you now know, this similarity engine thing drives a lot of things. So it's the magic that lets the AI navigate your data to be able to augment the COMPLETION. They go hand in hand. Left hand, right hand, together. Pretty amazing. Now we're going to go to the conclusion of this course. I'm going to miss you, but wait till you see what's up if you stick around for the next lesson.