Share via


KernelPluginExtensions.TryGetFunction Method

Definition

Gets a function from the collection by plugin and function names.

public static bool TryGetFunction (this Microsoft.SemanticKernel.IReadOnlyKernelPluginCollection plugins, string? pluginName, string functionName, out Microsoft.SemanticKernel.KernelFunction? func);
static member TryGetFunction : Microsoft.SemanticKernel.IReadOnlyKernelPluginCollection * string * string * KernelFunction -> bool
<Extension()>
Public Function TryGetFunction (plugins As IReadOnlyKernelPluginCollection, pluginName As String, functionName As String, ByRef func As KernelFunction) As Boolean

Parameters

plugins
IReadOnlyKernelPluginCollection

The collection.

pluginName
String

The name of the plugin storing the function.

functionName
String

The name of the function.

func
KernelFunction

The function, if found.

Returns

true if the specified plugin was found and the specified function was found in that plugin; otherwise, false.

Remarks

If pluginName is null or entirely whitespace, all plugins are searched for a function with the specified name, and the first one found is returned.

Applies to