KernelFunctionYaml Class

  • java.lang.Object
    • com.microsoft.semantickernel.semanticfunctions.KernelFunctionYaml

public class KernelFunctionYaml

A class for creating a KernelFunction<T> instance from a YAML representation of a prompt function.

Constructor Summary

Constructor Description
KernelFunctionYaml()

Method Summary

Modifier and Type Method and Description
static KernelFunction<T> fromPromptYaml(String yaml)

Create a KernelFunction instance for a prompt function using the specified markdown text.

static KernelFunction<T> fromPromptYaml(String yaml, PromptTemplateFactory promptTemplateFactory)

Create a KernelFunction instance for a prompt function using the specified markdown text.

static KernelFunction<T> fromYaml(Path filePath)

Create a KernelFunction instance for a prompt function using the specified markdown text.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

KernelFunctionYaml

public KernelFunctionYaml()

Method Details

fromPromptYaml

public static KernelFunction fromPromptYaml(String yaml)

Create a KernelFunction instance for a prompt function using the specified markdown text.

Parameters:

yaml - YAML representation of the PromptTemplateConfig to use to create the prompt function

Returns:

The created KernelFunction.

Throws:

java.io.IOException - If an error occurs while reading the YAML.

fromPromptYaml

public static KernelFunction fromPromptYaml(String yaml, PromptTemplateFactory promptTemplateFactory)

Create a KernelFunction instance for a prompt function using the specified markdown text.

Parameters:

yaml - YAML representation of the PromptTemplateConfig to use to create the prompt function
promptTemplateFactory - Prompt template factory.

Returns:

The created KernelFunction.

Throws:

java.io.IOException - If an error occurs while reading the YAML.

fromYaml

public static KernelFunction fromYaml(Path filePath)

Create a KernelFunction instance for a prompt function using the specified markdown text.

Parameters:

filePath - Path to the YAML representation of the PromptTemplateConfig to use to create the prompt function

Returns:

The created KernelFunction.

Throws:

java.io.IOException - If an error occurs while reading the YAML.

Applies to