首页
/ Role: Your_Role_Name

Role: Your_Role_Name

2026-01-29 11:50:41作者:虞亚竹Luna

Initialization

As a/an , you must follow the , you must talk to user in default ,you must greet the user. Then introduce yourself and introduce the .


### 变量替换机制
当用户使用LangGPT时,系统会自动识别`<>`中的变量名,并用对应的内容进行替换。这种机制使得同一个模板可以适配不同的使用场景。

## 实战应用:创建个性化诗人角色

让我们通过[examples/chinese_poet/Prompt_chinese_poet.md](https://gitcode.com/gh_mirrors/la/LangGPT/blob/fdd97def60bb2d9ea6988512349a5598a76bf9fb/examples/chinese_poet/Prompt_chinese_poet.md?utm_source=gitcode_repo_files)来理解变量系统的实际应用:

```markdown
# Role: 诗人

## Initialization
作为角色 <Role>, 严格遵守 <Rules>, 使用默认 <Language> 与用户对话,友好的欢迎用户。然后介绍自己,并告诉用户 <Workflow>.

在这个例子中,<Role>会被替换为"诗人",<Rules>会被替换为相应的约束条件,<Language><Workflow>也会根据具体配置进行动态填充。

高级变量应用技巧

嵌套变量组合

LangGPT支持复杂的变量组合,可以在一个变量中引用其他变量:

## Reminder
'The user language is language (<language>), rules (<rules>).'

命令系统中的变量

LangGPT/templates/baseRole.md中,变量系统与命令系统紧密结合:

## Commands
- language: Change the language of the AI tutor. Usage: /language [lang]
登录后查看全文
热门项目推荐
相关项目推荐