Introduction
Unless you've been living under a rock, you'll have seen some big news from Salesforce in the Generative AI space this week (29th Feb 2024, for future readers) - Prompt Builder is Generally Available and Copilot is in Beta.
I've been lucky enough to get my hands on both of these new features and have an initial dig around, so continue reading to find out how I got on with Prompt Builder. Like it's General Availability, my hands on experience with Copilot is coming soon!
Setup
Setting up Prompt Builder is very straightforward:
- Navigate to Setup -> Einstein Generative AI -> Einstein Setup and toggle it on
- Assign the Prompt Builder Manager/User permission sets
-
Reload Setup, then navigate to
Setup -> Einstein Generative AI -> Prompt Builder and
start prompting.
Creating Prompts
You are a Sales Executive and your name is {!$Input:Sender.Name} from an organization called {!$Input:Sender.CompanyName}. Your prospect is {!$Input:Recipient.Name}, who is the {!$Input:Recipient.Title}, from the company called {!$Input:Recipient.Company}.Your prospect {!$Input:Recipient.Name} attended a Salesforce release webinar that your company hosted.When I ask you to generate a follow-up email to your prospect you must strictly follow my instructions below.Instructions: """The salutation must only contain the recipient's first name.You must strictly not use "I hope this email finds you well" ,"I hope this email finds you doing well", or any other variation that expresses interest in the recipient's well-being to open the email.Create a follow-up email conveying that you are following up on their attendance of {!$Input:Webinar__c.Name} to see if they need any additional information or support.Mention the webinar, the number of attendees from {!$Input:Webinar__c.Attendee_Count__c} and include a summary of the {!$Input:Webinar__c.Description__c}. Express the hope that it was useful for them and that they will follow the call to action identified at {!$Input:Webinar__c.Call_to_Action__c}End the email with details of the two additional resources that are available : {!$Input:Webinar__c.Resource_1__c} , which is {!$Input:Webinar__c.Resource_1_Detail__c} and {!$Input:Webinar__c.Resource_2__c}, which is {!$Input:Webinar__c.Resource_2_Detail__c}Finish by indirectly encouraging your prospect {!$Input:Recipient.Name} to respond to your email by asking them if they need any further information, have questions or require assistance.Generate a subject line that can increase open rate using words and content related to the email body."""Now generate the follow-up email to your prospect.
Grounding the Prompt
I then provide a couple of sample records to test the prompt out. The Lead record is one that came with the org and will probably be familiar to anyone that has used a Salesforce Developer Edition before - Lauren Bailey from Omega, Inc. The webinar record is as follows:
The resolution section is useful when you are grounding the prompt with a number of inputs - it shows the expanded merge fields so you can see exactly what you'll be sending the AI model (although sensitive data will be masked by the Einstein Trust Layer, obviously):You are a Sales Executive and your name is Keir Bowden from an organization called Credera. Your prospect is Lauren Bailey, who is the Director of Services, from the company called Omega,Inc.Your prospect Lauren Bailey attended a Salesforce release webinar that your company hosted.When I ask you to generate a follow-up email to your prospect you must strictly follow my instructions below.Instructions: """The salutation must only contain the recipient's first name.You must strictly not use "I hope this email finds you well" ,"I hope this email finds you doing well", or any other variation that expresses interest in the recipient's well-being to open the email.Create a follow-up email conveying that you are following up on their attendance of Spring 24 Release Webinar to see if they need any additional information or support.Mention the webinar, the number of attendees from 150 and include a summary of the Learn about the key new features and enhancements in the Spring 24 release of Salesforce.. Express the hope that it was useful for them and that they will follow the call to action identified at Enable dynamic forms and add related objects to your records home pages.End the email with details of the two additional resources that are available : https://help.salesforce.com/s/articleView?id=release-notes.salesforce_release_notes.htm&language=en_US&release=248&type=5 , which is Salesforce Release Notes and https://www.youtube.com/watch?v=c4nKiYlQ6EU, which is Webinar RecordingFinish by indirectly encouraging your prospect Lauren Bailey to respond to your email by asking them if they need any further information, have questions or require assistance.Generate a subject line that can increase open rate using words and content related to the email body."""Now generate the follow-up email to your prospect.
The Response
Subject:Enhance Your Salesforce Experience with Spring 24 Release InsightsBody:Hello Lauren,I trust you found the Spring 24 Release Webinar insightful. With 150 attendees, we hope you gained valuable insights into the key new features and enhancements in the Salesforce Spring 24 release. The webinar highlighted how to enable dynamic forms and add related objects to your records home pages.For further exploration, two additional resources are available:- Salesforce Release Notes: https://help.salesforce.com/s/articleView?id=release-notes.salesforce_release_notes.htm&language=en_US&release=248&type=5- Webinar Recording: https://www.youtube.com/watch?v=c4nKiYlQ6EUShould you require any additional information, have questions, or need assistance, please feel free to reach out.Best regards,Keir BowdenCredera
Grounding with Apex/Flow
I can see I'll be doing a lot of grounding with pro or low code - if I'm sending an email regarding a product I'll probably want to include a rate card and maybe some contractual information for example. Grounding with Flow is very straightforward, and once you choose a Template Triggered Prompt Flow and pick the Sales Emails capability, there's a nice screen to define the object types you are using :
Apex is a little different - you define a class with an invocable method that defines the capability, then define Request and Response inner classes to manage the input and output parameters:
@InvocableMethod(label='Price for Lead' description='Gets the price of a product for a lead' CapabilityType='PromptTemplateType://einstein_gpt__salesEmail') public static List<Response> getProductStandardPrices(List<Request> requests)
--- --- ---
public class Request { @InvocableVariable(required=true) public User sender; @InvocableVariable(required=true) public Lead recipient; @InvocableVariable(required=true) public Webinar__c relatedObject; } public class Response { @InvocableVariable(required=true) public String Prompt; }
Apex is also a little different in that I couldn't get it to work! Even after copy/pasting the example in the Salesforce help, it wouldn't show up in the Resources selector. I'm sure this will be resolved soon, and as Prompt Builder has been one of Salesforce's more rapid features to go GA, I'm okay with their being a few glitches. As I've written before, I'll take a bit of additional effort tracking down issues if it means I get my hands on things earlier.
No comments:
Post a Comment