Skip to main content

探索提示设计模式

学习目标

完成本单元后,您将能够:

  • 识别四种核心的提示设计模式。
  • 运用每种模式解决不同的业务问题。
  • 认清不同任务应使用的模式。
  • 使用真实场景练习模式匹配。

了解提示设计模式

提示设计模式是针对某一特定类型任务的可复用模板。就像软件开发中的设计模式一样,提示模式以可预测的方式解决常见问题。

就像烘焙师在烘焙时有一套惯用技巧(如分层、折叠、醒面)一样,提示设计师在工作中也会依赖一套核心模式。每种模式都适用于不同的任务。以食谱为例,提示设计师在编写提示时会用到以下技巧:

  • 摘要:将一份完整的食谱精简为关键步骤。
  • 内容生成:根据手头现有的食材清单创建新食谱。
  • 转换:调整食谱以适应饮食限制或不同的菜系。
  • 提取:从完整食谱卡中仅提取食材清单。

模式 1:摘要

目的:将大量信息压缩为简短易读的格式。

适用场景:当文本内容过多、需要快速获取要点时。

用例示例:

  • 将较长的个案历史总结为 2 至 3 句话。
  • 从研究文档中提取关键发现。
  • 根据冗长的邮件线程创建简报。
  • 将会议记录精炼为待办事项。

提示示例:

Task: Summarize this customer support case
"""
Case Details:
Customer complained about billing issue. We investigated and found an error in our system from their third billing cycle. The charge was $250 when it should have been $150. We've issued a refund and applied an additional $50 credit. Customer responded positively.
"""
Instructions:
- Provide a 2-3 sentence summary
- Include the problem, resolution, and customer response
- Use clear, straightforward language
- Focus on what matters most

模式 2:内容生成

目的:根据提供的参数从零开始创建新内容。

适用场景:当您需要快速生成原创内容时。

用例示例:

  • 自动生成跟进邮件。
  • 创建产品描述。
  • 撰写社交媒体帖子。
  • 起草常见问题的回复。

提示示例:

Task: Generate a follow-up email to a customer who purchased but hasn't used the product yet
"""
Customer: John Smith
Product: Advanced Analytics Suite
Days since purchase: 14
Customer's industry: Financial Services
"""
Instructions:
- Write a friendly, non-pushy email
- Offer to help them get started
- Include one key benefit of the product
- Add a link to a getting-started guide
- Keep it under 150 words
Format: Email with subject line

模式 3:转换

目的:针对不同受众、语气或用途改写现有内容。

适用场景:当您需要对现有内容进行调整时。

用例示例:

  • 将技术文档改写为面向大众的版本。
  • 将正式语气改为对话式语气。
  • 针对不同平台调整内容(社交媒体 vs. 博客)。
  • 针对不同地区本地化内容。

提示示例:

Task: Transform this technical error message into a user-friendly message
"""
Original error: "NullPointerException in AuthenticationManager.validate() at line 247"
"""
Instructions:
- Remove technical jargon
- Explain what went wrong in simple terms
- Suggest what the user should do next
- Keep a helpful, not alarming tone
- Make it something a non-technical person would understand

模式 4:提取

目的:从非结构化文本中提取特定信息。

适用场景:当您需要从大量文本中找到特定数据点时。

用例示例:

  • 从会议记录中提炼待办事项。
  • 从电子邮件中提取客户联系信息。
  • 从长篇提案中识别关键需求。
  • 列出文档中提及的所有截止日期。

提示示例:

Task: Extract all action items and deadlines from this meeting transcript
"""
Meeting Transcript:
Sarah mentioned we need to finalize the budget by March 30. John said he'd handle the vendor calls. We also discussed launching the new feature—target date is April 15. Maria will coordinate with design by March 22.
"""
Instructions:
- List each action item
- Include the responsible person if mentioned
- Include the deadline if mentioned
- Use a simple bullet-point format
- If no deadline is mentioned, note "No deadline specified"

练习场景挑战

您已经了解全部四种模式的实际应用。现在是时候测试您的模式识别能力了。请阅读每个场景,判断哪种模式最为适合。每个场景只有一个正确答案。将正确的模式拖到对应的场景上。

熟练掌握这四种模式,是您作为提示设计师能做的最有价值的事情之一。大多数业务用例都是这四种模式中某一种的变体。一旦您能快速识别它们,编写提示就会容易得多。在下一个单元中,您将学习如何选择合适的模型来驱动您的提示。

在 Salesforce 帮助中分享 Trailhead 反馈

我们很想听听您使用 Trailhead 的经验——您现在可以随时从 Salesforce 帮助网站访问新的反馈表单。

了解更多 继续分享反馈