Newer Version Available

This content describes an older version of this product. View Latest

GenAiPromptTemplate

Represents the definition of a prompt template, including its related objects and fields.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type

This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location

GenAiPromptTemplate components have the suffix .genAiPromptTemplate and are stored in the genAiPromptTemplates folder.

Version

GenAiPromptTemplate components are available in API version 60.0 and later.

Special Access Rules

GenAiPromptTemplate is available only if Prompt Builder is enabled in your org and you have the Prompt Template Manager permission.

To send GenAiPromptTemplate components from one Salesforce org to another, you must use change sets.

Fields

Field Name Description
activeVersion
Field Type
int
Description
Specifies the version number of the active prompt template version.
description
Field Type
string
Description
A description of the prompt template.
masterLabel
Field Type
string
Description
A user-friendly name for GenAiPromptTemplate, which is defined when the GenAiPromptTemplate is created.
relatedEntity
Field Type
string
Description
The Salesforce record type that the prompt template is associated with.
relatedField
Field Type
string
Description
The Salesforce field that the prompt template is associated with.
templateVersions
Field Type
GenAiPromptTemplateVersion[]
Description
An array of prompt template versions.
type
Field Type
string
Description
Represents the template type that the prompt template is based on. Valid values are:
  • einstein_gpt__fieldCompletion
  • einstein_gpt__salesEmail
  • einstein_gpt__recordSummary
  • einstein_gpt__flex
visibility
Field Type
GenAiPromptTemplateVisibilityType (enumeration of type string)
Description
Indicates the scope of visibility for the prompt template. Valid values are:
  • API
  • Global

GenAiPromptTemplateVersion

Represents a version of a prompt template.

Field Name Description
content
Field Type
string
Description
Text of the prompt template version.
description
Field Type
string
Description
Description of the prompt template version.
inputs
Field Type
GenAiPromptTemplateInput[]
Description
An array of prompt template inputs associated with the prompt template version.
primaryModel
Field Type
string
Description
The model associated with the prompt template version.
status
Field Type
GenAiPromptTemplateStatus (enumeration of type string)
Description
Indicates the activation status of the prompt template in Prompt Builder. Valid values are:
  • Published—Prompt template appears as Active in Prompt Builder.

    Published prompt templates can’t be edited in Salesforce, but are currently editable from the Metadata API. We recommend that you don’t edit published prompt templates from the API.

  • Draft—Prompt Template appears as Inactive in Prompt Builder.
templateDataProviders
Field Type
GenAiPromptTemplateDataProvider[]
Description
An array of prompt template data providers associated with the prompt template version.
versionNumber
Field Type
int
Description
Required. Version number of the prompt template version. Versions are counted sequentially from 1.

GenAiPromptTemplateInput

Represents an input for a prompt template, such as a Salesforce record, field, or Apex primitive data type.

Field Name Description
apiName
Field Type
string
Description
Required. Name of the prompt template input parameter.
definition
Field Type
string
Description
Required. The URI definition of the input parameter. For example,  SOBJECT://Account and SOBJECT://Account/Description.
description
Field Type
string
Description
Description of the prompt template input parameter.
masterLabel
Field Type
string
Description
A user-friendly name for GenAiPromptTemplateInput, which is defined when the GenAiPromptTemplateInput is created.
referenceName
Field Type
string
Description
Required. Name of the prompt template input to use in expressions. For example, Input:Recipient and Input:Sender</referenceName>.
required
Field Type
boolean
Description
Required. Specifies whether this input parameter is required (true) or optional (false).

GenAiPromptTemplateDataProvider

Represents a source of data for a prompt template version, such as an invocable action, flow, or Apex method.

Field Name Description
definition
Field Type
string
Description
Required. The URI definition of the data provider, such as flow://ns__CallToActionFlow.
parameters
Field Type
GenAiPromptTemplateDataProviderParam[]
Description
An array of parameters associated with the data provider.
referenceName
Field Type
string
Description
Required. Name of the data provider to use in expressions.

GenAiPromptTemplateDataProviderParam

Represents a parameter that a data provider uses to retrieve information.

Field Name Description
definition
Field Type
string
Description
Required. URI definition of the parameter. For example,  SOBJECT://User</definition>.
isRequired
Field Type
boolean
Description
Specifies whether the parameter is required (true) or optional (false).
parameterName
Field Type
string
Description
Required. Name of the parameter.
valueExpression
Field Type
string
Description
Value or expression of the parameter to use in prompt template text. For example, {!$Input:Recipient}.

Wildcard Support in the Manifest File

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.