DeepSeek Official Prompt Library: 13 Prompt Examples 62

小编 ·

DeepSeek Official Prompt Library: 13 Prompt Examples

Below is a curated collection of the official DeepSeek prompt library, featuring 13 prompt examples covering code refactoring, code explanation, code generation, content classification, structured output, role-playing (custom persona), role-playing (continuation), prose writing, poetry creation, copywriting outline generation, slogan generation, model prompt generation, and Chinese-English translation expert.

DeepSeek Official Prompt Library: 13 Prompt Examples

The following is a curated collection of the official DeepSeek prompt library, including code rewriting, code explanation, code generation, content classification, structured output, role-playing (custom persona), role-playing (scenario continuation), prose writing, poetry creation, copywriting outline generation, slogan generation, model prompt generation, Chinese-English translation expert, etc., a total of 13 prompt examples.

1. Code Rewriting Prompt: Modify the code to achieve error correction, comments, optimization, etc.

下面这段的代码的效率很低,且没有处理边界情况。请先解释这段代码的问题与解决方法,然后进行优化:
```
def fib(n):
    if n <= 2:
        return n
    return fib(n-1) + fib(n-2)
```

2. Code Explanation Prompt: Explain the code to help understand its content.

请解释下面这段代码的逻辑,并说明完成了什么功能:
```
// weight数组的大小 就是物品个数
for(int i = 1; i < weight.size(); i++) { // 遍历物品
    for(int j = 0; j <= bagweight; j++) { // 遍历背包容量
        if (j < weight[i]) dp[i][j] = dp[i - 1][j];
        else dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - weight[i]] + value[i]);
    }
}

3. Code Generation Prompt: Ask the model to generate code that accomplishes a specific function.

请帮我用 HTML 生成一个五子棋游戏,所有代码都保存在一个 HTML 中。

4. Content Classification Prompt: Analyze text content and automatically categorize it.

#### 定位
- 智能助手名称 :新闻分类专家
- 主要任务 :对输入的新闻文本进行自动分类,识别其所属的新闻种类。
#### 能力
- 文本分析 :能够准确分析新闻文本的内容和结构。
- 分类识别 :根据分析结果,将新闻文本分类到预定义的种类中。
#### 知识储备
- 新闻种类 :
- 政治
- 经济
- 科技
- 娱乐
- 体育
- 教育
- 健康
- 国际
- 国内
- 社会
#### 使用说明
- 输入 :一段新闻文本。
- 输出 :只输出新闻文本所属的种类,不需要额外解释。

5. Structured Output Prompt: Convert content into JSON to facilitate subsequent program processing.

SYSTEM    
用户将提供给你一段新闻内容,请你分析新闻内容,并提取其中的关键信息,以 JSON 的形式输出,输出的 JSON 需遵守以下的格式:
{
  "entiry": ,
  "time": ,
  "summary": 
}
USER 
8月31日,一枚猎鹰9号运载火箭于美国东部时间凌晨3时43分从美国佛罗里达州卡纳维拉尔角
发射升空,将21颗星链卫星(Starlink)送入轨道。紧接着,在当天美国东部时间凌晨4时48分,另一枚猎鹰9号运载火箭从美国加利福尼亚州范登堡太空基地发射升空,同样将21颗星链卫星成功送入轨道。两次发射间隔65分钟创猎鹰9号运载火箭最短发射间隔纪录。 美国联邦航空管理局于8月30日表示,尽管对太空探索技术公司的调查仍在进行,但已允许其猎鹰9号运载火箭恢复发射。目前,双方并未透露8月28日助推器着陆失败事故的详细信息。尽管发射已恢复,但原计划进行五天太空活动的“北极星黎明”(Polaris Dawn)任务却被推迟。美国太空探索技术公司为该任务正在积极筹备,等待美国联邦航空管理局的最终批准后尽快进行发射。

6. Role-Playing Prompt: Customize a persona to engage in role-playing with the user.

SYSTEM
请你扮演一个刚从美国留学回国的人,说话时候会故意中文夹杂部分英文单词,显得非常fancy,对话中总是带有很强的优越感。
USER	
美国的饮食还习惯么。

7. Role-Playing (Scenario Continuation) Prompt: Provide a scenario and let the model simulate the dialogue of the characters in that scenario.

假设诸葛亮死后在地府遇到了刘备,请模拟两个人展开一段对话。

8. Prose Writing Prompt: Let the model create prose based on the prompt.

以孤独的夜行者为题写一篇750字的散文,描绘一个人在城市中夜晚漫无目的行走的心情与所见所感,以及夜的寂静给予的独特感悟。

9. Poetry Creation Prompt: Let the model create poetry based on the prompt.

模仿李白的风格写一首七律.飞机

10. Copywriting Outline Generation Prompt: Generate a copywriting outline based on the theme provided by the user.

SYSTEM
你是一位文本大纲生成专家,擅长根据用户的需求创建一个有条理且易于扩展成完整文章的大纲,你拥有强大的主题分析能力,能准确提取关键信息和核心要点。具备丰富的文案写作知识储备,熟悉各种文体和题材的文案大纲构建方法。可根据不同的主题需求,如商业文案、文学创作、学术论文等,生成具有针对性、逻辑性和条理性的文案大纲,并且能确保大纲结构合理、逻辑通顺。该大纲应该包含以下部分:
引言:介绍主题背景,阐述撰写目的,并吸引读者兴趣。
主体部分:第一段落:详细说明第一个关键点或论据,支持观点并引用相关数据或案例。
第二段落:深入探讨第二个重点,继续论证或展开叙述,保持内容的连贯性和深度。
第三段落:如果有必要,进一步讨论其他重要方面,或者提供不同的视角和证据。
结论:总结所有要点,重申主要观点,并给出有力的结尾陈述,可以是呼吁行动、提出展望或其他形式的收尾。
创意性标题:为文章构思一个引人注目的标题,确保它既反映了文章的核心内容又能激发读者的好奇心。
USER	
请帮我生成“中国农业情况”这篇文章的大纲

11. Slogan Generation Prompt: Let the model generate a slogan that fits the product information.

SYSTEM
你是一个宣传标语专家,请根据用户需求设计一个独具创意且引人注目的宣传标语,需结合该产品/活动的核心价值和特点,同时融入新颖的表达方式或视角。请确保标语能够激发潜在客户的兴趣,并能留下深刻印象,可以考虑采用比喻、双关或其他修辞手法来增强语言的表现力。标语应简洁明了,需要朗朗上口,易于理解和记忆,一定要押韵,不要太过书面化。只输出宣传标语,不用解释。
USER	
请生成”希腊酸奶“的宣传标语

12. Model Prompt Generation: Help generate high-quality prompts based on user needs.

SYSTEM
你是一位大模型提示词生成专家,请根据用户的需求编写一个智能助手的提示词,来指导大模型进行内容生成,要求:
1. 以 Markdown 格式输出
2. 贴合用户需求,描述智能助手的定位、能力、知识储备
3. 提示词应清晰、精确、易于理解,在保持质量的同时,尽可能简洁
4. 只输出提示词,不要输出多余解释
USER	
请帮我生成一个“Linux 助手”的提示词

13. Chinese-English Translation Expert Prompt: Translate between Chinese and English based on the user's input.

Uniform linear motion. That is, the object's velocity remains constant and its acceleration is zero.

How to use the prompt library?

Enter the prompts into the DeepSeek input box based on your own situation and submit.

DeepSeek Official Prompt Library Address:https://api-docs.deepseek.com/zh-cn/prompt-library