Repository navigation
How can you combine both prompt functions and native code functions in one plugin? #5709
Answered
by
stephentoub
Valentin Nikolov (Valkozaur)
asked this question in
Q&A
|
Hello SK users. I am developing a chat application. Is that possible? |
Answered by
stephentoub
Apr 1, 2024
Replies: 1 comment 1 reply
|
You can create a new plugin that contains all the functions from other plugins, e.g. KernelPlugin plugin1 = ...;
KernelPlugin plugin2 = ...;
KernelPlugin combined = KernelPluginFactory.CreateFromFunctions("MyCoolPlugin", [..plugin1, ..plugin2]);You can also write your own KernelPlugin-derived types. Here's an example of writing and using a mutable one that let's you add and remove functions. |
1 reply
Answer selected by
Valkozaur
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can create a new plugin that contains all the functions from other plugins, e.g.
You can also write your own KernelPlugin-derived types. Here's an example of writing and using a mutable one that let's you add and remove functions.
https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/KernelSyntaxExamples/Example69_MutableKernelPlugin.cs