本文是《Prompt Engineering Techniques | 提示词工程技巧》的练习操作步骤。阅读原文请见:Prompt Engineering Techniques | 提示词工程技巧。
1. Sign Up for a Developer Edition Org
- Sign up for a free [Developer Edition org with Agentforce](https://trailhead.salesforce.com/promo/orgs/agentforce-for-trailhead).
- Fill out the form, click Sign me up, open the activation email, and click Verify Account.
- Connect the org to Trailhead: Connect Org, sign in, Allow, then Yes! Save it.
2. Set Up Agentforce
- Click the gear icon and select Setup.
- Search for and select Einstein Setup, and ensure the Turn on Einstein toggle is On; refresh.
- Search for and select Agentforce Agents, and ensure the Agentforce toggle is On.
3. Create a Zero-Shot Prompt Template
- Search for and select Prompt Builder, then New Prompt Template.
- Type Flex, Name
Generate Sample Email, APIGenerate_Sample_Email, DescriptionCreates a basic email template., then Next. - Paste the provided zero-shot instruction into the Prompt text area.
- Click Preview Settings and, under Inputs, select Burlington Textiles Corp of America for Customer Account.
- Click Save & Preview and review the Resolved Prompt and Generated Response.
4. Edit the Prompt with Few-Shot Examples
- Click Prompt to return to your prompt.
- Replace the text with the provided few-shot prompt.
- Click Save & Preview and review the improved response.
5. Create a Chain-of-Thought Prompt Template
- Click the back arrow to return to Prompt Builder Setup, then New Prompt Template.
- Type Einstein AI-Generated Search Answers, Name
Resort Package Names, APIResort_Package_Names, DescriptionGenerates package names for Coral Cloud resort offerings based on the provided details., then Next. - Click Preview Settings and enter: Query
Generate 5 Package names, plusprivate villas,beachside dining,family-friendly atmosphere. - Paste the provided prompt text and click Save and Preview.
- Review the generated package names in the Response.
6. Add Chain-of-Thought Instructions
- Click Prompt to return to your prompt.
- Replace the prompt text with the provided chain-of-thought prompt (including "explain your thought process for each package step-by-step").
- Keep the query and chunks the same.
- Click Save & Preview and review the updated response with reasoning.