PromptyKernelExtensions.CreateFunctionFromPromptyFile 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.
Create a KernelFunction from a prompty template file.
public static Microsoft.SemanticKernel.KernelFunction CreateFunctionFromPromptyFile (this Microsoft.SemanticKernel.Kernel kernel, string promptyFilePath, Microsoft.SemanticKernel.IPromptTemplateFactory? promptTemplateFactory = default);
static member CreateFunctionFromPromptyFile : Microsoft.SemanticKernel.Kernel * string * Microsoft.SemanticKernel.IPromptTemplateFactory -> Microsoft.SemanticKernel.KernelFunction
<Extension()>
Public Function CreateFunctionFromPromptyFile (kernel As Kernel, promptyFilePath 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.
- promptyFilePath
- String
Path to the file containing the Prompty representation of a prompt based KernelFunction.
- promptTemplateFactory
- IPromptTemplateFactory
The IPromptTemplateFactory to use when interpreting the prompt template configuration into a IPromptTemplate. If null, a AggregatorPromptTemplateFactory will be used with support for Liquid and Handlebars prompt templates.
Returns
The created KernelFunction.
Exceptions
promptyFilePath
is null.
promptyFilePath
is empty or composed entirely of whitespace.