作为一名DeepSeek的重度用户,我每天都在用它来提高工作效率。经过大量实践,我总结出了十个超级实用的prompt技巧,这些prompt能让DeepSeek的输出质量大幅提升。今天,我要和大家分享这些经过实战检验的prompt模板,让大家的工作效率也能翻倍提升。
1. 角色定制prompt
1.1 专家角色模板
class ExpertPrompt:
def __init__(self):
self.base_template = """
你现在是一位{expertise}领域的资深专家,
具有{years}年实战经验。
请基于以下背景:{background}
解答这个问题:{question}
要求:
1. 回答要专业且易懂
2. 举具体实例说明
3. 给出可行的建议
"""
def generate(self, expertise, years, background, question):
"""生成专家角色prompt"""
return self.base_template.format(
expertise=expertise,
years=years,
background=background,
question=question
)
# 使用示例
expert = ExpertPrompt()
prompt = expert.generate(
expertise="Python开发",
years=10,
background="开发一个高并发系统",
question="如何优化数据库访问性能?"
)
小贴士:角色设定越具体,DeepSeek的回答就越专业。建议在expertise中详细说明专业方向。
2. 结构化思维prompt
2.1 MECE分析框架
class MECEPrompt:
def __init__(self):
self.template = """
请使用MECE(互相独立,完全穷尽)方法,
分析以下问题:{question}
分析框架:
1. 维度拆解
- 时间维度
- 空间维度
- 人员维度
- 资源维度
2. 每个维度下:
- 现状分析
- 问题诊断
- 解决方案
- 实施建议