Citations Apex Classes

This page contains the reference material for citations in Apex. For a guide on using these classes, see Get Started with Citations Apex. To generate inline citations via the Agent API, see Agent API Examples.

This class contains the data that an action returns to the Agentforce reasoning engine. The reasoning engine can then use this data if the citations service is called.

PropertyTypeDescription
inputTextstringThe data from the action.
sourcesGenAiSourceReferenceThe source information.

Represents a source of information for generating citations.

PropertyTypeDescription
idstringThe ID of the source information.
contentsGenAiSourceContentInfoThe content of the source information
metadataGenAiSourceReferenceInfoMetadata on the source information.

Represents specific content from a source that's being cited.

PropertyTypeDescription
fieldNamestringNot required. The name of the field from the source.
objectNamestringNot required. The object that the source data originates from.
contentstringThe data from the source.

Represents metadata for a source reference.

PropertyTypeDescription
linkstringA link to the source content.
source_object_record_idstringThe ID for the source object.
source_object_api_namestringThe API name for the source.
labelstringThe custom label for the source.

This class enables actions to directly provide citations for responses without calling the citations service through the Agentforce reasoning engine. This class closely resembles the output of the citations service.

PropertyTypeDescription
referencesGenAiCitedReferenceThe reference to a source.

Represents a citation or reference to a source.

PropertyTypeDescription
metadataGenAiCitedReferenceInfoThe metadata for a source.

Represents metadata for a cited reference.

PropertyTypeDescription
linkstringA link to the cited source content.
source_object_record_idstringThe ID for the source object.
source_object_api_namestringThe API name for the source.
labelstringThe custom label for the source.