-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move several IKernel methods to a KernelExtensions class
`IKernel` declares 7 overloads of `RunAsync`, and `Kernel` dutifully implements all 7, but 6 of them are one-liner convenience methods that just delegate to the 7th. Rather than having all of these on the interface and making any implementer implement them all, 6 of them can just be extension methods. `IKernel` also declares an `ImportFunctions` method, which is almost entirely reflection-based logic unrelated to the kernel instance: the only thing it actually needs from the kernel is to be able to add functions to its functions collection, and `RegisterCustomFunction` provides that. So `ImportFunctions` can also be made into an extension method, such that any `IKernel` implementation gets it for free, and the interface is less cluttered. Also fixed the nullable annotation on Kernel's ctor's ILoggerFactory parameter.
- Loading branch information
1 parent
bdc517d
commit 5522897
Showing
5 changed files
with
186 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.