Skip to main content

Functions And Plugins In Semantic Kernel

It's been a while since Semantic Kernel is around and in the last few months, a lot of many things have changed, specifically from the implementation point of view. Hence, I thought of summarize the key functions to help you understand better, which are also listed in Evan's blog.. As of today, there are 3 different ways to add plugins into the Semantic Kernel. Here are those:

  • From a directory: Need to provide parent_directory and plugin_name 
  • Using KernelPlugin instance 
  • Using KernelFunction: Need to create a custom class or a dictionary where methods are decorated with kernel_function

Similarly, there are few different ways to add functions in Semantic Kernel:

  • KernelFunction.from_prompt a.k.a KernelFunctionFromPrompt(function_name, plugin_name, description, prompt, template_format, prompt_template, prompt_template_config, prompt_execution_settings) 
  • KernelFunctionFromPrompt.from_yaml(yaml_str, plugin_name (optional))
  • KernelFunctionFromPrompt.from_directory(path, plugin_name (optional)) 
  • KernelFunction.from_method a.k.a KernelFunctionFromMethod(method, plugin_name, stream_method) (where the method has name, description, etc. defined through the decorator)
If you're looking to get started with Semantic Kernel, then check my video series here.

Comments