MarkdownKernelExtensions.CreateFunctionFromMarkdown Method

Definition

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

public static Microsoft.SemanticKernel.KernelFunction CreateFunctionFromMarkdown (this Microsoft.SemanticKernel.Kernel kernel, string text, string functionName, Microsoft.SemanticKernel.IPromptTemplateFactory? promptTemplateFactory = default);
static member CreateFunctionFromMarkdown : Microsoft.SemanticKernel.Kernel * string * string * Microsoft.SemanticKernel.IPromptTemplateFactory -> Microsoft.SemanticKernel.KernelFunction
<Extension()>
Public Function CreateFunctionFromMarkdown (kernel As Kernel, text As String, functionName As String, Optional promptTemplateFactory As IPromptTemplateFactory = Nothing) As KernelFunction

Parameters

kernel
Kernel

The Kernel containing services, plugins, and other state for use throughout the operation.

text
String

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

functionName
String

The name of the function.

promptTemplateFactory
IPromptTemplateFactory

The IPromptTemplateFactory to use when interpreting the prompt template configuration into a IPromptTemplate. If null, a default factory will be used.

Returns

The created KernelFunction.

Applies to