Developing native plugins
Let’s start with native functions. Native functions are regular code in your language of choice (Python or C#) and do not necessarily require a specific directory structure, unlike semantic functions. However, it is easier to put the native functions together with the main code of your program. This will make it easier to import the classes.
Avoid duplicate names
Since semantic functions are directories and native functions are source code files, it’s possible to have a semantic function and a native function with the same name inside a plugin, for example a directory named my_function
and a source code file named my_function.py
. If you do that, the last function loaded (the source code file) will overwrite the first, leading to unexpected problems. Therefore, avoid duplicate names. At the time of writing, Semantic Kernel does not provide a warning when this happens.
Let’s look at the directory structure of our plugins.