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.

Fields

Field Name Description
activeVersion
Field Type
int
Description
This tag will be deprecated in 63.0 and will not work in 64.0 and later. Use activeVersionIdentifier instead.
activeVersionIdentifier
Field Type
string
Description
Specifies the version identifier of the active prompt template version. This tag will use versionIdentifier as the value for the active version.
description
Field Type
string
Description
A description of the prompt template.
masterLabel
Field Type
string
Description
Required. 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
Required. An array of prompt template versions.
type
Field Type
string
Description
Required. 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
  • einstein_gpt__caseEmailDraft
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
Required. 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
Required. Indicates the status of the prompt template in Prompt Builder. Valid values are:
  • Published—Published version of a prompt template. The active version of the prompt template must be published.

    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—Draft version of a prompt template.
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.

This tag will be deprecated in 63.0 and will not work in 64.0 and later. Use versionIdentifier instead.

versionIdentifier
Field Type
string
Description

Version identifier of the prompt template version identifier. This is generated automatically once a template is deployed and retrieved from an org.

If a unique value is not specified then it will be generated for you. It must be unique for each version for a given template.

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
Required. 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.