Newer Version Available

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

EinsteinLLM Class

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

Namespace

ConnectApi

EinsteinLLM Methods

These methods are for EinsteinLLM. All methods are static.

generate​MessagesFor​PromptTemplate​(promptTemplate​DevName, prompt​Template​GenerationsInput)

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

API Version

60.0

Requires Chatter

No

Signature

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

Parameters

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.

Example

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

getPromptTemplates(query, sortBy, offset, pageLimit, fields, type, relatedEntity, isActive)

Get a list of prompt templates using the specified filters.

API Version

62.0

Requires Chatter

No

Signature

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

Parameters

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.

Usage

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

Example