Freigeben über


PromptTemplateConfig Class

Definition

Provides the configuration information necessary to create a prompt template.

public sealed class PromptTemplateConfig
type PromptTemplateConfig = class
Public NotInheritable Class PromptTemplateConfig
Inheritance
PromptTemplateConfig

Remarks

A prompt template is a template that can be used to generate a prompt to be submitted to an AI service. For basic prompts, the template may be supplied as a simple string. For more complex prompts, more information is desirable for describing the prompt template, such as details on input variables expected by the template. This can all be provided by a PromptTemplateConfig, where its Template is the prompt template string itself, then with other properties set with additional information. To create the actual prompt template, a IPromptTemplateFactory is used to create an IPromptTemplate; this is done automatically by the APIs that accept a PromptTemplateConfig, using a default template factory that understands the SemanticKernelTemplateFormat format, but with the ability to supply other factories for interpreting other formats.

Constructors

PromptTemplateConfig()

Initializes a new instance of the PromptTemplateConfig class.

PromptTemplateConfig(String)

Initializes a new instance of the PromptTemplateConfig class using the specified prompt template string.

Properties

AllowDangerouslySetContent

Gets or sets a value indicating whether to allow potentially dangerous content to be inserted into the prompt from functions.

DefaultExecutionSettings

Gets the default execution settings from ExecutionSettings.

Description

Gets or sets a function description to use by default when creating prompt functions using this configuration.

ExecutionSettings

Gets or sets the collection of execution settings used by the prompt template.

InputVariables

Gets or sets the collection of input variables used by the prompt template.

Name

Gets or sets the function name to use by default when creating prompt functions using this configuration.

OutputVariable

Gets or sets the output variable used by the prompt template.

SemanticKernelTemplateFormat

Gets the identifier of the Semantic Kernel template format.

Template

Gets or sets the prompt template string that defines the prompt.

TemplateFormat

Gets or sets the format of the prompt template.

Methods

AddExecutionSettings(PromptExecutionSettings, String)

Adds the specified PromptExecutionSettings to the ExecutionSettings dictionary.

FromJson(String)

Creates a PromptTemplateConfig from the specified JSON.

Applies to