本文是《Service Agent Customization with Prompts, Flows and Actions — 服务代理自定义》的练习操作步骤。阅读原文请见:Service Agent Customization with Prompts, Flows and Actions — 服务代理自定义。
1. Get the Org Ready and Update Details
- Click the Setup icon and select Setup. The Setup page opens in a new tab.
- In the Setup Quick Find, search for and select Salesforce Go.
- In the Search features... textbox, enter and select Agentforce Studio.
- Click Get Started.
- Click Turn On.
- Click Confirm.
2. Update User Details
- In the Setup Quick Find, search for and select Users.
- Select the Edit action next to the EinsteinServiceAgent User.
- Update Company to
Coral Cloud Resorts. - Update the Profile to Einstein Agent User.
- Click Save.
3. Improve a Prompt Template
- In the Setup Quick Find, search for and select Prompt Builder.
- Scroll down and select the prompt named Generate Personalized Schedule.
- Enter this text:
Your name is . You work in the guest success team at . - Place your cursor before the first period after the word *is*. Click + Insert Resource and select Current User > First Name.
- Place your cursor after User.FirstName, click the spacebar to add a space. Click + Insert Resource and select Current User > Last Name.
- Place your cursor before the second period after the word *at*. Click + Insert Resource and select Current User > Company Name.
- Find the line starting with "Present the list of". Delete Present and replace with
Always introduce yourself with your full name, then present. - Find the line:
Tell the guest to reach out if they'd like to book any of these activities.Put cursor at end, press Enter, and add:Information about the guest is here: - Place cursor after "here:", press spacebar, click + Insert Resource and select Contact > Record Snapshot.
- Press Enter, then enter:
Use this information about the guest. Use a casual style of writing.
### Test the Prompt
- Click the Preview Settings icon to expand the Preview Settings section.
- In the Contact box, search for and select Sofia Rodriguez.
- Click Save & Preview.
- Review the Response section to see how the prompt template affects the test response.
4. Update the Prompt Template Model
- In Prompt Builder, click the Template Settings icon to open the Template Settings section.
- Expand the Inputs section and ensure the Model Type is set to Standard.
- Select OpenAI GPT 4 Omni Mini from the Models dropdown menu.
- Click the Preview Settings icon and ensure Sofia Rodriguez still appears in the Contact box. Ensure Response Language is English.
- Click Save & Preview.
- Click the Template Settings icon, then click View this model in the Model section to open the AI Models editor.
- Click Edit.
- In the Model Configuration side panel, select Create model radio button.
- Change the Temperature to 0.3 by moving the slider. Leave other settings as is.
- Enter this prompt:
Write a 200-word article about how surfing got started. Include specific facts, people, and dates.Click Generate to test. - Click Save.
- Name:
Business Writing - Description:
This model will be less creative, and therefore should hallucinate less. - Select Create Model.
- Name:
- After creating the model, click Close.
### Test the Model
- If the Generate Personalized Schedule prompt is not still open, go to Setup > Prompt Builder > select Generate Personalized Schedule.
- Ensure the Template Settings section is open. Set Model Type to Custom.
- Ensure Business Writing is selected in the Model dropdown.
- Click Save.
- Click the Preview Settings icon. In Contact box, search for Sofia Rodriguez. Click Preview.
- Click Activate.
- Click the back arrow to return to Setup.
5. Update the Get Experience Details Flow
- In the Setup Quick Find, search for and select Flows.
- Scroll down and select the flow named Get Experience Details.
- Click the Get Experience by Name element.
- On the right, scroll down and click Add Field.
- In the Field box, enter
price, then select Price__c from the list. - Click the Assign Experience Record element (close the AI assistant if needed).
- Change the Description to:
Assign an Experience__c record for presentation back to the user with details about the requested experience. - Click Save As New Version then click Save.
- Click Activate.
- Click the back arrow in Flow Builder to return to Setup.
6. Update the Corresponding Agent Action
- Click Setup icon and select Setup.
- In the Setup Quick Find, enter and select Agentforce Assets.
- Click the Actions tab.
- Select the Get Experience Details action.
- Scroll down to Output, click the pencil icon next to the instructions for the output variable
experienceRecord. - Enter the new instructions:
Assign an Experience__c record for presentation back to the user with details about the requested experience. - Click Save.
7. Import a New Agent with Agent Builder
- Click the App Launcher icon, search for and select Agentforce Studio.
- Click the down arrow next to New Agent and select New from Script.
- Paste in the provided Agent Script.
- Click Create Agent.
- If necessary, click Service Agent Coral Cloud to open the agent.
- Click Save (upper right corner).
- In the Assign a user record section, select Select User.
- Click Search users… and select EinsteinServiceAgent User.
- Click Save.
8. Update the Topic Instructions
- In the AI assistant in the Agentforce pane on the right, enter:
Add two additional instructions to the Customer Experience Support subagent: 1.If asked about an experience Name, Description, Activity Level, Type or Price, then call {!@actions.Get_Experience_Details}. 2.If asked to recommend experiences that a user might be interested in, use {!@actions.Generate_Personalized_Schedule} to generate a schedule based on the contacts interests. Use the contact record from {!@actions.Get_Customer_Details} and pass it into the Contact input.
- Click Accept All.
- Click Save.
- Click Commit Version and then click Commit Version again to confirm.
- Click Activate and then click Activate again to confirm.
9. Test the Updates
- Click the Preview tab.
- Click the Live Test Mode dropdown at the top and select Simulate Mode. Click Switch.
- Enter:
Tell me more about the Guided Nature Walk.(Note: Price is now included in the response.) - Enter:
book 2 people for a Guided Nature Walk for tomorrowand pick a time to complete the booking. - Enter:
I am sofiarodriguez@example.com and my membership number is 10008155. - Enter:
Can you generate a personalized schedule of experiences for today?