0% found this document useful (0 votes)
29 views

Get Started with Prompt Builder-Exercise-Guide

Uploaded by

vasireddysrk92
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Get Started with Prompt Builder-Exercise-Guide

Uploaded by

vasireddysrk92
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

We love feedback!

Get Started With Prompt Builder


EXERCISE GUIDE

Learn more at: http://sfdc.co/successplanresources

.
0
EXERCISE GUIDE
Get Started With Prompt Builder

Log in to Salesforce

Instructions:

1. Navigate to the Salesforce login page.


a. Open Google Chrome or another internet browser.
NOTE: Google Chrome is recommended.
b. Enter https://login.salesforce.com into the browser’s address bar.
c. Press Enter.
2. Log in using the username and password provided to you by your instructor.

Optionally, open the related Quip document at http://sfdc.co/quickpb for this session to find text
that you can copy and paste as you complete the exercises.

© Copyright 2024 salesforce.com, inc. All rights reserved. 1


EXERCISE GUIDE
Get Started With Prompt Builder

Exercise 1: Create a Field Generation Template

Task 1: Enable Einstein Features

1. Select the Setup icon and then select Setup.


2. Enable Einstein:
a. Use Quick Find to search for and open Einstein Setup.
b. Verify that Einstein is turned on. If not, toggle the Turn on Einstein slider to On.
c. Refresh your browser page if you had to turn it on.

Task 2: Create a Field Generation Template

1. Use Quick Find to search for and open Prompt Builder.


2. Select New Prompt Template.
3. Configure the prompt template with the values listed here.
Long text strings can be copied from the related Quip document at
http://sfdc.co/aicopypaste.

Field Value

Prompt Template Type Field Generation

Generate Experience
Prompt Template Name Description

API Name [Keep default]

This template is used to


Template Description generate a description for a
resort experience.

Object Experience

Object Field Description

4. Select Next.

© Copyright 2024 salesforce.com, inc. All rights reserved. 2


EXERCISE GUIDE
Get Started With Prompt Builder

5. Paste this text in the Prompt Template Workspace:

You are a marketer at ORGANIZATION_NAME.


The resort provides experiences guests can book throughout the day.
Write a marketing description for the experience below.
Make it sound unique and exciting.
Highlight the benefits of the experience.
The description should be between 80 and 100 words.

Experience name: EXPERIENCE_NAME


Type: EXPERIENCE_TYPE
Location: EXPERIENCE_LOCATION
Duration: EXPERIENCE_DURATION
Level: EXPERIENCE_LEVEL
Capacity: EXPERIENCE_CAPACITY

6. Replace the placeholders with the corresponding merge fields (use the Resource field to
access merge fields):

Placeholder Merge Field API Name

ORGANIZATION_NAME Current Organization > Name Organization.Name

EXPERIENCE_NAME Experience > Experience Name Input:Experience__c.Name

EXPERIENCE_TYPE Experience > Type Input:Experience__c.Type__c

EXPERIENCE_LOCATION Experience > Location Input:Experience__c.Location__c

EXPERIENCE_DURATION Experience > Duration (Hours) Input:Experience__c.Duration_Hours__c

EXPERIENCE_LEVEL Experience > Activity Level Input:Experience__c.Activity_Level__c

EXPERIENCE_CAPACITY Experience > Capacity Input:Experience__c.Capacity_c

7. To preview, select Aqua Fitness in Paradise in the Related Record field. "Aqua Fitness in
Paradise" is one of the experiences offered at Coral Cloud.
8. Select Save & Preview.
9. In the Resolution panel, examine the prompt that was generated. Notice that the merge
fields have been replaced with the actual values for the "Aqua Fitness in Paradise" record.
10. In the Response panel, examine the experience description that was generated by the LLM.
11. Try adjusting the template instructions. For example, change the number of words you want
the generated description to have. Select Save & Preview again to review the results.

© Copyright 2024 salesforce.com, inc. All rights reserved. 3


EXERCISE GUIDE
Get Started With Prompt Builder

12. Select Activate when you’re satisfied with your template.

Task 3: Bind the Template to the Experience Description Field

1. In the App Launcher, select the Coral Cloud app and go to the Experiences tab. Select the
Aqua Fitness in Paradise record.
2. Select the Setup icon and select Edit Page.
3. Select the Description field.
4. In the right panel under Einstein Generative AI, select Generate Experience Description as
the prompt template to be used to generate the experience description.
5. Select Save.
6. Select the back arrow to leave App Builder and go back to the Experience record.
7. Select Edit (the pencil icon) next to the Description field.
8. Select Sparkle next to the Description input field to get Einstein’s help in creating this field
value. It will take a few seconds for Einstein to create a description.
9. Select Use to add the generated description to the Description field.
10. Select Save to save the record.

© Copyright 2024 salesforce.com, inc. All rights reserved. 4


EXERCISE GUIDE
Get Started With Prompt Builder

Exercise 2: Create a Flex Template

Task 1: Create the Flex template

1. In Setup, use Quick Find to search for and select Prompt Builder.
2. Select New Prompt Template.
3. Configure the Prompt Template as:

Parameter Value

Prompt Template Type Flex

Prompt Template Name Generate Personalized Schedule

API Name [Keep default]

Generate a personalized schedule that


includes the time and location of
Template Description resort experiences that are available
today, and that match the guest's
interests.

Name Contact

API Name myContact

Source Type Object

Object Contact

4. Select Next.

© Copyright 2024 salesforce.com, inc. All rights reserved. 5


EXERCISE GUIDE
Get Started With Prompt Builder

5. Paste this text in the Prompt Template Workspace:

Your name is {!$User.FirstName}. You work in the guest success team at


{!$Organization.Name}.
Introduce yourself, then present the list of resort activities happening
today that match the guest's interests.
For clarity, use a bullet list.
For each activity, include name, time, location, and duration on a
single line. Do not include the date.
Tell the guest to reach out if they'd like to book any of these
activities.
List of activities happening today that match the guest's interests:

6. In the Preview panel, select Sofia Rodriguez as the Contact.


7. Select Save & Preview.
8. In the Resolution panel, examine the prompt that was generated.
9. In the Response panel, examine the personalized list that the LLM generated.
10. Select Activate.

Task 2: Create an Apex Class To Ground the Template with Data

1. In Setup, use Quick Find to search for and select Apex Classes.
2. Select New.

© Copyright 2024 salesforce.com, inc. All rights reserved. 6


EXERCISE GUIDE
Get Started With Prompt Builder

3. Add this code:

public with sharing class PersonalizedGuestExperiences {


// Make this method available for grounding
// the Generate_Personalized_Schedule prompt template
@InvocableMethod
public static List<Response> getSessions(List<Request>
requests) {
Request input = requests[0];
Contact contact = input.myContact;
List<Session__c> sessions =
ExperienceSessionController.getSessions(contact);
// Create expected response
List<Response> responses = new List<Response>();
Response res = new Response();
res.prompt = JSON.serialize(sessions);
responses.add(res);
return responses;
}
// The variables in this class need to match the prompt
template inputs,
// that may be different on each prompt template
public class Request {
@InvocableVariable(required=true)
public Contact myContact;
}
public class Response {
@InvocableVariable
public String Prompt;
}
}

4. Select Save.

Task 3: Ground the Template with Apex Data

1. In Setup, use Quick Find to search for and select Prompt Builder.
2. Select the Generate Personalized Schedule template to open it.

© Copyright 2024 salesforce.com, inc. All rights reserved. 7


EXERCISE GUIDE
Get Started With Prompt Builder

3. In the Template Workspace, add a line after List of activities happening today that match
the guest's interests.
4. Use the Resource field and select: Apex > PersonalizedGuestExperiences.
5. Select Save As, then Save as New Version.
6. In the Preview panel, select Sofia Rodriguez as the contact.
7. Select Preview.

Task 4: Use the Reasoning Capabilities of Large Language Models

1. Modify the prompt template as:

Your name is {!$User.FirstName}. You work in the guest success team at


{!$Organization.Name}.
Introduce yourself, then present the list of resort activities happening
today that match the guest's interests.
For clarity, use a bullet list.
For each activity, include name, time, location, and duration on a
single line. Do not include the date.
Then add a suggested schedule.
Take into account the start time and duration of each activity.
Make sure that you don't include activities that overlap.
Make sure the guest has at least 60 minutes of free time between
activities.
Present the suggested schedule in chronological order.
Tell the guest to reach out if they'd like to book any of these
activities.
List of activities happening today that match the guest's interests:
{!$Apex:PersonalizedGuestExperiences.Prompt}

2. Select Save & Preview.


3. If the suggested schedule doesn't seem right (for example, it features experiences that
overlap), select the OpenAI GPT 4 Turbo model in the configuration panel, and select Save
& Preview again.
4. Select Activate when you’re satisfied with your template.

Task 5: Use the Prompt in a Screen Flow

1. In Setup, search for and select Flows.


2. Open the Personalized Schedule flow.

© Copyright 2024 salesforce.com, inc. All rights reserved. 8


EXERCISE GUIDE
Get Started With Prompt Builder

3. Mouse over the circle under the Get Contact element, select +, search for Generate, and
select Generate Personalized Schedule.
4. Configure the action as:

Field Value

Label Invoke Prompt

API Name [Keep default]

Description Invoke the Generate Personalized Schedule Prompt

Select Contact from Get Contact. Remove the period that’s


Contact
automatically added after {!Get_Contact}

5. Select the x icon to close the Personalized Schedule action.


6. Select the Display Result element, and then select Edit Element.
7. Select the Display Text component.
8. Select Insert Variable Here.
9. In the Resource Picker, search and select Outputs from Invoke_Prompt >
promptResponse. Make sure you delete "Insert Variable Here" if it appears in the rich edit
area.
10. Select Done.
11. Select Save As, then A New Version. Then select Save.
12. Select Activate.
13. In the App Launcher, start the Coral Cloud Resort app, go to the Contacts tab, and open
Sofia Rodriguez.
14. Select the Personalized Schedule Quick Action and observe the pop-up with a personalized
schedule.

© Copyright 2024 salesforce.com, inc. All rights reserved. 9


EXERCISE GUIDE
Get Started With Prompt Builder

Exercise 3: Salesforce Labs AI Library

Instructions: Follow along with the Salesforce expert as they show you a collection of premade
prompt templates available on the Salesforce Labs AI Library. These free, premade prompt
templates are created and curated by Salesforce employees to help you get started with Einstein 1.
To use these on your own, repeat Exercise 2, but substitute a premade template from the website.

Task 1: Try a Free, Premade Prompt Template

1. Access the Salesforce Labs AI Library website.


2. Click Sales icon to explore sales prompt templates
3. Click Generate a sales POV
4. Review the template description.
5. Observe it is of type Field Generation
6. When you find a template you can use, select Copy Text and paste the free template into a
prompt template workspace and use it.

© Copyright 2024 salesforce.com, inc. All rights reserved. 10

You might also like