Share via


KernelFunctionFromMethod Class

Semantic Kernel Function from a method.

Initializes a new instance of the KernelFunctionFromMethod class.

Constructor

KernelFunctionFromMethod(method: Callable[[...], Any], plugin_name: str | None = None, stream_method: Callable[[...], Any] | None = None, parameters: list[KernelParameterMetadata] | None = None, return_parameter: KernelParameterMetadata | None = None, additional_metadata: dict[str, Any] | None = None)

Parameters

Name Description
method
Required
<xref:Callable>[<xref:...>,<xref: Any>]

The method to be called

plugin_name
<xref:<xref:semantic_kernel.functions.str | None>>

The name of the plugin

Default value: None
stream_method
<xref:Callable>[<xref:...>,<xref: Any>]<xref: | None>

The stream method for the function

Default value: None
parameters
list[<xref:KernelParameterMetadata>]<xref: | None>

The parameters of the function

Default value: None
return_parameter
<xref:<xref:semantic_kernel.functions.KernelParameterMetadata | None>>

The return parameter of the function

Default value: None
additional_metadata
dict[str,<xref: Any>]<xref: | None>

Additional metadata for the function

Default value: None

Methods

gather_function_parameters

Gathers the function parameters from the arguments.

gather_function_parameters

Gathers the function parameters from the arguments.

gather_function_parameters(context: FunctionInvocationContext) -> dict[str, Any]

Parameters

Name Description
context
Required

Attributes

method

method: Callable[[...], Any]

stream_method

stream_method: Callable[[...], Any] | None