[Agent] Define Prompt Template
The Agent define prompt template
operation is very useful when you want to use specific prompt templates. The prompt template language is a simple way to define and compose AI functions using plain text. You can use it to create natural language prompts, generate responses, extract information, invoke other prompts, or perform any other task that can be expressed with text.

Input Fields
Module Configuration
This refers to the Einstein AI configuration set up in the getting started section.
General Operation Fields
- Template: This field contains the prompt template for the operation.
- Instructions: This field contains the instructions for the LLM and goals towards the result.
- Dataset: The dataset that needs to be evaluated by the LLM using the template and instructions for this operation.
Additional Properties
- Model Name: The model name to be used (default is
OpenAI GPT 3.5 Turbo
). - Probability: The model's probability to stay accurate (default is
0.8
). - Locale: Localization information, which can include the default locale, input locale(s), and expected output locale(s) (default is
en_US
).
Input Example (Json)
Below is the payload example for this operation:
{
"template": "You are a customer satisfaction agent, who analyses the customer feedback in the dataset. Answer via json output and add a type for the result only with positive or negative as well as the complete answer",
"instructions":"If the customer feedback in the dataset is negative, open a service satisfaction case and apologize to the customer. If the customer feedback in the dataset is positive, thank the customer and wish them a nice day. Don't repeat the feedback and be more direct starting the conversation with formal greetings",
"dataset": "The training last week was amazing, we learned so much and the trainer was very friendly."
}
XML Configuration
Below is the XML configuration for this operation:
<mac-einstein:agent-define-prompt-template
doc:name="Agent define prompt template"
doc:id="e82292dc-8a92-4ed8-a863-fafceaac711c"
config-ref="Einstein_AI"
template="#[payload.template]"
instructions="#[payload.instructions]"
dataset="#[payload.dataset]"
/>
Output Field
This operation responds with a json
payload.
Example Response
Below is an example output for this operation:
{
"payload": {
"response": "{\n \"type\": \"positive\",\n \"answer\": \"Thank you for your positive feedback on the training last week! We are glad to hear that you found it amazing and that you learned a lot. We appreciate your kind words about the friendly trainer. Have a nice day!\"\n}"
},
"attributes": {
"generationId": "61bdab41-5793-4b6d-bcc1-950ddd34abdd",
"responseParameters": {
"tokenUsage": {
"outputCount": 59,
"totalCount": 184,
"promptTokenDetails": {
"cachedTokens": 0,
"audioTokens": 0
},
"completionTokenDetails": {
"reasoningTokens": 0,
"rejectedPredictionTokens": 0,
"acceptedPredictionTokens": 0,
"audioTokens": 0
},
"inputCount": 125
},
"systemFingerprint": null,
"model": "gpt-3.5-turbo-0125",
"object": "chat.completion"
},
"generationParameters": {
"refusal": null,
"index": 0,
"logprobs": null,
"finishReason": "stop"
},
"contentQuality": {
"scanToxicity": {
"categories": [
{
"categoryName": "identity",
"score": "0.0"
},
{
"categoryName": "hate",
"score": "0.0"
},
{
"categoryName": "profanity",
"score": "0.0"
},
{
"categoryName": "violence",
"score": "0.0"
},
{
"categoryName": "sexual",
"score": "0.0"
},
{
"categoryName": "physical",
"score": "0.0"
}
],
"isDetected": false
}
},
"responseId": "chatcmpl-B5WrHMIgyxcXsi9V8C48g3iZzTD5m"
}
}
Example Use Cases
Prompt templates can be used in various scenarios, such as:
- Customer Service Agents: For customer service teams, prompt templates can be very useful to provide case summaries, case classifications, summarizing large datasets, and more.
- Sales Operation Agents: For sales teams, prompt templates help with writing sales emails, summarizing cases for specific accounts, assessing the probability to close deals, and more.
- Marketing Agents: For marketing teams, prompt templates can help generate product descriptions, create newsletters, plan social media campaigns, and more.