Using generative AI to solve simple problems
Microsoft Semantic Kernel distinguishes between two types of functions that can be loaded into it: semantic functions and native functions.
Semantic functions are functions that connect to AI services, usually LLMs, to perform a task. The service is not part of your codebase. Native functions are regular functions written in the language of your application.
The reason to differentiate a native function from any other regular function in your code is that the native function will have additional attributes that will tell the kernel what it does. When you load a native function into the kernel, you can use it in chains that combine native and semantic functions. In addition, Semantic Kernel planner can use the function when creating a plan to achieve a user goal.
Creating semantic functions
We have already created a semantic function (knock
) in the previous section. Now, we’re going to add a parameter to it. The default...