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.kernel_function_from_method.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
|
The parameters of the function Default value: None
|
|
return_parameter
|
<xref:<xref:semantic_kernel.functions.kernel_function_from_method.KernelParameterMetadata | None>>
The return parameter of the function Default value: None
|
|
additional_metadata
|
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
invocation_duration_histogram
invocation_duration_histogram: metrics.Histogram
metadata
metadata: KernelFunctionMetadata
method
method: Callable[[...], Any]
stream_method
stream_method: Callable[[...], Any] | None
streaming_duration_histogram
streaming_duration_histogram: metrics.Histogram