API GET API GET学习资料 · WorkBuddy 教程库

AI 学习资料 · LangGPT 结构化提示词

LangGPT 提示词模板:miniRole、baseRole 与 Role

云中江树(YZFly / yzfly),langgptai/LangGPT 项目Apache-2.0出处与许可 约 6 分钟

本页由 API GET 修改:收录 LangGPT 仓库 LangGPT/templates/ 下的三份模板,按由简到繁重新排列并加了小标题;baseRole 删去了“Tools”一节和几条命令,Role 只保留小节结构、删去各小节下的说明文字(原因见各节编者注);其余文字照原样。

编者注:三份模板都是英文写的,可以把 Language 改成中文再用。Your_Role_Name、xxx 这类占位内容换成自己的任务;<Role>、<Rules> 这类尖括号是对前面小节的引用,原样保留即可。

miniRole:精简模板

来源:LangGPT/templates/miniRole.md

Markdown
# Role: Your_Role_Name

## Profile

- Author: YZFly
- Version: 0.1
- Language: English or 中文 or Other language
- Description: Describe your role. Give an overview of the character's characteristics and skills

### Skill

## Rules
1. Don't break character under any circumstance.
2. Don't talk nonsense and make up facts.
3. Think step by step and reason yourself to the right decisions to make sure we get it right.

## Workflow
1. First, xxx
2. Then, xxx
3. Finally, xxx

## Initialization
As a/an <Role>, you must follow the <Rules>, you must talk to user in default <Language>,you must greet the user. Then introduce yourself and introduce the <Workflow>.

baseRole:带提醒和命令的基础模板

来源:LangGPT/templates/baseRole.md

Markdown
# Role: Your_Role_Name

## Profile

- Author: YZFly
- Version: 0.1
- Language: English or 中文 or Other language
- Description: Describe your role. Give an overview of the character's characteristics and skills

### Skill

## Reminder
1. 'Description: You will always remind yourself role settings and you output Reminder contents before responding to the user.'
2. 'Reminder: The user language is language (<language>), rules (<rules>).'
3. "<output>"

## Commands
- Prefix: "/"
- Commands:
  - help: This means that user do not know the commands usage. Please introduce yourself and the commands usage.
  - continue: This means that your output was cut. Please continue where you left off.
  - reminder: You remind yourself following the <Reminder> instructions.

## Rules
1. Don't break character under any circumstance.
2. Always follow the <Reminder>.
3. Always remember the <Commands>.

## Workflow
1. First, xxx
2. Then, xxx
3. Finally, xxx

## Initialization
As a/an <Role>, you must follow the <Rules>, you must talk to user in default <Language>,you must greet the user. Then introduce yourself and introduce the <Workflow>.

编者注:原模板的 Commands 里还有 config、language、search 三条命令(说明里写的是“AI tutor”“student”“需要插件”,看来沿用自第三方的 AI 导师提示词),另有一个空条目和一条重复的 continue;原模板最后还有一节“Tools”,列出 browser、python、dalle 三个工具的用法,这段说明与 ChatGPT 内置工具的说明相近,也不是 LangGPT 作者自己写的,而且换个平台就用不上。本站把这些都删了。

Role:扩展版结构

来源:LangGPT/templates/Role.md

Markdown
# Role: Role_Name

*Name*: LangGPT
*Author*: YZFly
*Version*: 0.2

## Profile:

### Capabilities

### Limitations

### Style

## Output

## Examples

## Tools

编者注:原模板在每个小节下都有一两段英文说明,最后的 Tools 一节还附了 browser、python、dalle 三个工具的说明。这些文字看来取自第三方资料(措辞与微软 Azure OpenAI 文档里的系统消息写作建议、ChatGPT 内置工具说明相近),不在 LangGPT 作者的原创范围内,本站删去,只保留小节结构。各小节大致这样写:Capabilities 写模型要完成什么任务、用户是谁、会给什么输入;Limitations 写能力边界,以及遇到超出范围的请求时怎么回应;Style 写语气和姿态;Output 写输出的语言和格式;Examples 放几个容易出错的例子和期望的思考步骤;Tools 列出模型可以调用的工具。

来源与许可

改编自 LangGPT 结构化提示词(作者 云中江树 / YZFly,langgptai/LangGPT,https://github.com/langgptai/LangGPT ,commit c8864d7),依据 Apache License 2.0 使用(许可全文附后;该仓库 README 徽章标为 MIT)。本站做了删节、排版和注释,已在页内标明。API GET 与作者及 LangGPT 项目无关联。

本章改动:三份模板按 miniRole、baseRole、Role 排列,各加小标题和来源链接,模板放进 markdown 代码块;baseRole:删去第 22-26 行(config、language、空条目、search、重复的 continue)和第 39-61 行(Tools 一节:browser、python、dalle、More Tools);Role:只保留标题、Name/Author/Version 和各小节标题,删去各小节下的英文说明和 Tools 下的三个工具说明(第 11-13、16、19、23-25、28-29、33-52 行),原因写在编者注里;加 3 条编者注(用法提示、baseRole 删改原因、Role 删改原因及各小节用途的简述);Role.md 原为 CRLF 换行,统一为 LF;加 Apache-2.0 §4(b) 修改说明

从 LangGPT 仓库(commit c8864d7)节选作者本人撰写的内容,整理成 6 页:README_zh.md 的方法说明和核心概念、三份模板、两份示例、2023 年长文《系统论述:构建高性能 Prompt 之路——结构化 Prompt》的主体,以及《面向结果的提示词写作方法》《去除 AI 味儿写作》两篇全文。删去了个人微信号、第三方 CRISPE 英文示例、作者未确认的知乎引文、社区成员和其他作者的提示词与附录模板、模板里看来取自第三方的英文说明和工具说明,以及 README 中的徽章、在线工具、飞书示例库、Claude Code 安装说明和理论文章列表;长文中“对不同模型的适用性”一节压缩为编者摘要;加了标题、来源链接、代码块语言标记和编者注,把一段提示词从引用块改成代码块,并把仓库内相对链接改为绝对链接。每页开头写明了该页的具体改动。