Share via


KernelFunction Class

Definition

Represents a function that can be invoked as part of a Semantic Kernel workload.

public abstract class KernelFunction
type KernelFunction = class
Public MustInherit Class KernelFunction
Inheritance
KernelFunction

Properties

Description

Gets a description of the function.

ExecutionSettings

Gets the prompt execution settings.

JsonSerializerOptions

The JsonSerializerOptions to use for serialization and deserialization of various aspects of the function.

Metadata

Gets the metadata describing the function.

Name

Gets the name of the function.

PluginName

Gets the name of the plugin this function was added to.

Methods

AsAIFunction(Kernel)

Creates an AIFunction for this KernelFunction.

Clone(String)

Creates a new KernelFunction object that is a copy of the current instance but the KernelFunctionMetadata has the plugin name set.

InvokeAsync(Kernel, KernelArguments, CancellationToken)

Invokes the KernelFunction.

InvokeAsync<TResult>(Kernel, KernelArguments, CancellationToken)

Invokes the KernelFunction.

InvokeCoreAsync(Kernel, KernelArguments, CancellationToken)

Invokes the KernelFunction.

InvokeStreamingAsync(Kernel, KernelArguments, CancellationToken)

Invokes the KernelFunction and streams its results.

InvokeStreamingAsync<TResult>(Kernel, KernelArguments, CancellationToken)

Invokes the KernelFunction and streams its results.

InvokeStreamingCoreAsync<TResult>(Kernel, KernelArguments, CancellationToken)

Invokes the KernelFunction and streams its results.

ToString()

Returns a string that represents the current object.

Extension Methods

ToToolDefinition(KernelFunction, String)

Convert KernelFunction to an OpenAI tool model.

Applies to