PromptYamlKernelExtensions.CreateFunctionFromPromptYaml Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.