Newer Version Available

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

GenAiFunction

Represents a copilot action that can be added to Einstein Copilot.

Parent Type

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

File Suffix and Directory Location

GenAiFunction components have the suffix .genAiFunction and are stored in the genAiFunctions folder.

Version

GenAiFunction components are available in API version 60.0 and later.

Special Access Rules

GenAiFunction is available only if Einstein Copilot is enabled in your org.

Fields

Field Name Description
description
Field Type
string
Description
A description explaining the general purpose and domain of the action.
invocationTarget
Field Type
string
Description

Required. Target invocation used by invocation operations.

invocationTargetType
Field Type
PlannerFunctionInvocableTargetType (enumeration of type string)
Description

Required. Invocable action types used by invocation operations.

Values are:

  • apex
  • flow
  • prompt
isConfirmationRequired
Field Type
boolean
Description
Indicates whether confirmation is required for this action.
masterLabel
Field Type
string
Description

Required. The master label for the generative AI action.

Declarative Metadata Sample Definition

The following is an example of a GenAiFunction component.

1<?xml version="1.0" encoding="UTF-8"?>
2<GenAiFunction xmlns="http://soap.sforce.com/2006/04/metadata">
3    <description>get tracking information</description>
4    <invocationTarget>TrackShipment</invocationTarget>
5    <invocationTargetType>apex</invocationTargetType>
6    <isConfirmationRequired>false</isConfirmationRequired>
7    <masterLabel>get_tracking_info</masterLabel>
8</GenAiFunction>

The following is an example package.xml that references the previous definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3   <types>
4      <members>*</members>
5      <name>GenAiFunction</name>
6   </types>
7   <version>60.0</version>
8</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.