Share via


KernelFunctionParameter Interface

Implements

java.lang.annotation.Annotation

public interface KernelFunctionParameter
implements java.lang.annotation.Annotation

Annotates a parameter to a native function

Field Summary

Modifier and Type Field and Description
static final java.lang.String NO_DEFAULT_VALUE

A special value that is used to indicate that no default value is provided.

Method Summary

Modifier and Type Method and Description
abstract java.lang.String defaultValue()

The default value of the parameter.

abstract java.lang.String description()

The description of the parameter.

abstract java.lang.String name()

The name of the parameter.

abstract boolean required()

Whether a value is required for this argument.

abstract java.lang.Class<?> type()

The type of the parameter.

Field Details

NO_DEFAULT_VALUE

public static final String NO_DEFAULT_VALUE

A special value that is used to indicate that no default value is provided.

Method Details

defaultValue

public abstract String defaultValue()

The default value of the parameter. If no value is set, null will be passed as the value to this argument.

Returns:

the default value of the parameter, or NO_DEFAULT_VALUE if no default value is provided.

description

public abstract String description()

The description of the parameter. The description should be short and concise. The model uses the description to determine what value to pass to the function.

Returns:

the description of the parameter, or an empty string if no description is provided.

name

public abstract String name()

The name of the parameter. This element is required.

Returns:

the name of the parameter, or an empty string if no name is provided.

required

public abstract boolean required()

Whether a value is required for this argument. If required is false, the model is free to choose whether to provide a value. If the model does not provide a value, the default value is used.

Returns:

whether a value is required for this argument.

type

public abstract Class type()

The type of the parameter. The Semantic Kernel will use the type to find a ContextVariableType<T> to convert the value from a prompt string to the correct argument type. The type defaults to String if not provided.

Returns:

the type of the parameter

Applies to