Hi Ghazal,
The issue you’re encountering (KeyError: 'recommender') usually means that the plugin or one of its functions is not being properly recognized or registered by Semantic Kernel.
In Semantic Kernel, there are two main ways to add and use plugins: one is through prompt-based plugins, which require a specific folder structure containing skprompt.txt and config.json; the other is through native code plugins, where you define your plugin as a Python class and use the @kernel_function decorator on its methods. This error often happens if the plugin folder name, plugin name, or function name used in your code doesn’t exactly match what is defined or loaded into the kernel. For prompt-based plugins, it’s important to ensure that the folder and file names are correct and that you are using add_plugin_from_directory() to load them.
However, we recommend using native code plugins, especially when getting started. You can define a class with your functions and register it using kernel.add_plugin(MyPlugin(), plugin_name="recommender"). This method also integrates smoothly with AI function calling. Switching to this approach should help you avoid plugin registration issues and make your development process smoother.
For more information: What is a Plugin
I hope this information helps. Thank you!