Class KernelFunctionYaml
- java.lang.Object
-
- com.microsoft.semantickernel.semanticfunctions.KernelFunctionYaml
-
public class KernelFunctionYaml extends Object
A class for creating aKernelFunctioninstance from a YAML representation of a prompt function.
-
-
Constructor Summary
Constructors Constructor Description KernelFunctionYaml()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> KernelFunction<T>fromPromptYaml(String yaml)Create a KernelFunction instance for a prompt function using the specified markdown text.static <T> KernelFunction<T>fromPromptYaml(String yaml, PromptTemplateFactory promptTemplateFactory)Create a KernelFunction instance for a prompt function using the specified markdown text.static <T> KernelFunction<T>fromYaml(Path filePath)Create a KernelFunction instance for a prompt function using the specified markdown text.
-
-
-
Method Detail
-
fromPromptYaml
public static <T> KernelFunction<T> fromPromptYaml(String yaml, @Nullable PromptTemplateFactory promptTemplateFactory) throws IOException
Create a KernelFunction instance for a prompt function using the specified markdown text.- Type Parameters:
T- The return type of the function.- Parameters:
yaml- YAML representation of the PromptTemplateConfig to use to create the prompt functionpromptTemplateFactory- Prompt template factory.- Returns:
- The created KernelFunction.
- Throws:
IOException- If an error occurs while reading the YAML.
-
fromPromptYaml
public static <T> KernelFunction<T> fromPromptYaml(String yaml) throws IOException
Create a KernelFunction instance for a prompt function using the specified markdown text.- Type Parameters:
T- The return type of the function.- Parameters:
yaml- YAML representation of the PromptTemplateConfig to use to create the prompt function- Returns:
- The created KernelFunction.
- Throws:
IOException- If an error occurs while reading the YAML.
-
fromYaml
public static <T> KernelFunction<T> fromYaml(Path filePath) throws IOException
Create a KernelFunction instance for a prompt function using the specified markdown text.- Type Parameters:
T- The return type of the function.- Parameters:
filePath- Path to the YAML representation of the PromptTemplateConfig to use to create the prompt function- Returns:
- The created KernelFunction.
- Throws:
IOException- If an error occurs while reading the YAML.
-
-