Newer Version Available

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

Prompt Template Actions

Creates a response based on the large language model (LLM) response for the specified prompt template and inputs.

This object is available in API version 60.0 and later.

This action is available only if you enable Prompt Builder and the user who runs the flow has the Prompt Template User permission.

The API name for each action is prefixed with generatePromptResponse.

Supported REST HTTP Methods

URI
Get a list of available Prompt Template actions: /services/data/vXX.X/actions/custom/generatePromptResponse
Get information about a specific Prompt Template action: /services/data/vXX.X/actions/custom/generatePromptResponse/template_API_name
Formats
JSON, XML
HTTP Methods
GET, HEAD, POST
Authentication
Authorization: Bearer token

Inputs

Input Details
citationMode
Type
Picklist
Description
Specifies how citations are returned:
  • in_generation: Return citations in generation
  • post_generation: Return citations after generation
  • off: Don’t return citations
GenAiPromptTemplateVersionId
Type
string
Description
The ID of the prompt template version that runs when this prompt template is called.
inputs
Type
Array of objects
Description
Inputs to the prompt template called by the Prompt Template Action. The request body format varies based on input type (objects or data model objects (DMO)).

Sample Input Request Body

Use this schema when your prompt template expects structured inputs such as record references.

1{
2  "inputs": [
3    {
4      "Input:Query": "What's the weather?",
5      "Input:Account": {
6        "Id": "001SB00001J9OCYYA3"
7      },
8	"Input:DMO": {
9	  "Id": "qJQ000001567000GAA"
10       },
11       "GenAiPromptTemplateVersionId": "3vNSB000000Y6Nx2AK",
12       "citationMode": "off"
13    }
14  ]
15}
16

Use this schema when your prompt template only needs simple string inputs.

1{
2  "inputs": [
3    {
4      "Input:Query": "What's the weather?",
5    }
6  ]
7}
8

Additional input values vary according to the input variables specified for the prompt template.

Outputs

Output Details
citations
Type
AiCopilot.GenAiCitationOutput
Description
Information about the citations associated with this response.
promptResponse
Type
string
Description
The prompt response generated by the action. The generated response is based on the specified prompt template and input.
structuredResponse
Type
Apex class
Description
The structured response of the generated text. The type can be a standard or custom Apex class.