GenAiFunction
Parent Type
File Suffix and Directory Location
GenAiFunction components have the suffix .genAiFunction and are stored in the genAiFunctions folder.
GenAiFunction components can contain folders for the input and output schemas. Here’s an example component, showing the schema folders.
See the Input Folder and Output Folder sections for more information.
Version
GenAiFunction components are available in API version 60.0 and later.
Special Access Rules
GenAiFunction is available only if Agents is enabled in your org.
Fields
Field Name | Description |
---|---|
description |
|
invocationTarget |
|
invocationTargetType |
|
isConfirmationRequired |
|
isIncludeInProgressIndicator |
|
mappingAttributes |
|
masterLabel |
|
progressIndicatorMessage |
|
GenAiPlannerAttr
Field Name | Description |
---|---|
description |
|
label |
|
name |
|
parameterName |
|
parameterType |
|
Input Folder
The input folder contains a schema.json file with the action inputs. Here’s a sample input schema file.
{
"required" : ["OwnerId", "Status"],
"properties" : {
"OwnerId" : {
"title" : "Owner Id",
"description" : "ID of the Salesforce record that owns the request.",
"lightning:type" : "lightning__textType",
"lightning:isPII" : false,
"copilotAction:isUserInput" : true
},
"Status" : {
"title" : "Request Status",
"description" : "The status of the contact request.",
"lightning:type" : "lightning__textType",
"lightning:isPII" : false,
"copilotAction:isUserInput" : true
}
},
"lightning:type" : "lightning__objectType"
}
This table describes the properties that you can specify in this JSON file.
Output Folder
The output folder contains a schema.json file with the action output. Here’s a sample output schema file.
{
"properties" : {
"Id" : {
"title" : "Contact Request Id",
"description" : "ID of the Salesforce contact request record.",
"lightning:type" : "lightning__recordIdType",
"lightning:isPII" : false,
"copilotAction:isDisplayable" : true,
"copilotAction:isUsedByPlanner" : true
}
},
"lightning:type" : "lightning__objectType"
}
This table describes the properties that you can specify in this JSON file.
Declarative Metadata Sample Definition
The following is an example of a GenAiFunction component.
<?xml version="1.0" encoding="UTF-8"?>
<GenAiFunction xmlns="http://soap.sforce.com/2006/04/metadata">
<description>get tracking information</description>
<invocationTarget>TrackShipment</invocationTarget>
<invocationTargetType>apex</invocationTargetType>
<isConfirmationRequired>false</isConfirmationRequired>
<masterLabel>get_tracking_info</masterLabel>
</GenAiFunction>
The following is an example package.xml that references the previous definition.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>GenAiFunction</name>
</types>
<version>60.0</version>
</Package>
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.