Lesson 4: Describe all plugins in Semantic Kernel chatbotΒΆ
In this lesson we will add functionality to list all plugins and plugin parameters that are loaded in the application's Semantic Kernel instance.
-
Ensure all pre-requisites are met and installed.
-
Switch to Lesson 5 directory:
-
Start by copying
appsettings.json
from Lesson 1: -
Run program to validate the code is functional:
-
Locate TODO: Step 1 - Add import for ModelExtensionMethods in
Program.cs
and add the following import: -
Next locate TODO: Step 2 - add call to print all plugins and functions in
Program.cs
and add the following lines to print out kernel plugins info: -
Next locate TODO: Step 3 - Comment out all code after "Execute program" comment and comment all lines of code after the
//Execute program
line. -
Re-run the program and you should see an output similar to this:
********************************************** ****** Registered plugins and functions ****** ********************************************** Plugin: GetCurrentUtcTime GetCurrentUtcTime: Retrieves the current time in UTC. Plugin: GetStockPrice GetStockPrice: Gets stock price Params: - symbol: default: '' Plugin: GetStockPriceForDate GetStockPriceForDate: Gets stock price for a given date Params: - symbol: default: '' - date: default: ''
-
Review the
Core.Utilities.Extensions.ModelExtensionMethods
class in theCoreUtilities
project to understand how the plugins are traversed to print out plugins and corresponding plugin parameters information.