Partager via


PromptYamlKernelExtensions.CreateFunctionFromPromptYaml Method

Definition

Creates a KernelFunction instance for a prompt function using the specified YAML.

public static Microsoft.SemanticKernel.KernelFunction CreateFunctionFromPromptYaml (this Microsoft.SemanticKernel.Kernel kernel, string text, Microsoft.SemanticKernel.IPromptTemplateFactory? promptTemplateFactory = default);
static member CreateFunctionFromPromptYaml : Microsoft.SemanticKernel.Kernel * string * Microsoft.SemanticKernel.IPromptTemplateFactory -> Microsoft.SemanticKernel.KernelFunction
<Extension()>
Public Function CreateFunctionFromPromptYaml (kernel As Kernel, text 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

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