EinsteinLLM Class

Get a list of prompt templates and generate LLM responses for prompt templates.

ConnectApi

These methods are for EinsteinLLM. All methods are static.

Generates a response using the specified prompt template and input parameters.

60.0

No

public static ConnectApi.EinsteinPromptTemplateGenerationsRepresentation generateMessagesForPromptTemplate(String promptTemplateDevName, ConnectApi.EinsteinPromptTemplateGenerationsInput promptTemplateGenerationsInput)

promptTemplateDevName

Type: String

Developer name or ID of a prompt template record.

promptTemplateGenerationsInput

Type: ConnectApi.EinsteinPromptTemplateGenerationsInput

Input for generating a response using the specified prompt template.

Type: ConnectApi.EinsteinPromptTemplateGenerationsRepresentation

In this example, call generateMessagesForPromptTemplate(promptTemplateDevName, promptTemplateGenerationsInput) to resolve a Sales Email prompt template. For more examples, see Resolve a Prompt Template.

Get a list of prompt templates using the specified filters.

62.0

No

public static ConnectApi.EinsteinPromptRecordCollectionOutputRepresentation getPromptTemplates(String query, String sortBy, Integer offset, Integer pageLimit, List<String> fields, String type, String relatedEntity, Boolean isActive)

query

Type: String

User-entered search string. If null, all prompt template records are returned.

sortBy

Type: String

Field to sort the returned prompt template records by, such as createdDate. If null, records are returned in the order they’re retrieved.

offset

Type: Integer

Used for pagination. Number of rows to skip between returned prompt template records. The default value is 0.

pageLimit

Type: Integer

Used for pagination. Maximum number of prompt template records returned per page. The default value is 50.

fields

Type: List<String>

Comma-separated list of prompt template record fields to return, such as createdDate. If null, all fields are returned.

type

Type: String

Prompt template type to filter records by, such as einstein_gpt__salesEmail. If null, records of all types are returned.

relatedEntity

Type: String

Related entity to filter records by, such as Contact. If null, all records with all related entities are returned.

isActive

Type: Boolean

Specifies whether to return active prompt templates only. The default is false.

Type: ConnectApi.EinsteinPromptRecordCollectionOutputRepresentation

To get a list of prompt templates, you must have Einstein Generative AI enabled and the Execute Prompt Templates user permission.