角色设计
角色名是唯一必填的字段。其余字段都可以留空,你仍可在对话中使用该角色。
角色描述
用于向 AI 添加角色描述及其他相关信息。这些信息始终会包含在提示词中,因此所有重要信息都应填写在这里。
例如,你可以添加故事发生的世界背景,描述角色的外貌、人格和过往经历。
它的长度不限(无论是 200 还是 2000 token),也可以采用任何格式风格(自由文本、伪代码对话风格等)。
方法与格式
角色格式化的方法是一个复杂的话题,超出了本文档的讨论范围。
以下是经过验证或依赖 SillyTavern 功能的推荐指南:
- Trappu 的 PLists + Ali:Chat 指南:https://wikia.schneedc.com/bot-creation/trappu/creation
- AliCat 的 Ali:Chat 指南:https://rentry.co/alichat
- kingbri 的极简指南:https://rentry.co/kingbri-chara-guide
角色 token
TL;DR:如果你使用的 AI 模型上下文 token 上限为 2048,那么一份 1000 token 的角色定义会将 AI 的“记忆”削减一半。
具体来说,一个优秀 AI 的一条不错的回复很容易达到 200-300 token。在这种情况下,AI 大约只能“记住” 3 轮左右的聊天历史。
为什么我的角色 token 计数器变红了?
当检测到你的角色定义超过了模型所定义上下文长度一半的 token 时,我们会对此进行高亮提示,因为这会降低 AI 提供愉快对话的能力。
如果我的角色 token 过多会怎样?
不必担心——这不会造成任何破坏。最坏的情况是,如果角色的永久 token 过大,只会导致上下文中留给其他内容的空间变少(见下文)。
唯一的负面影响是 AI 的“记忆”会变少,因为它能用来处理的聊天历史会更少。
这是因为每个 AI 模型一次能处理的上下文量都有上限。
“上下文”?
这是每次你要求 AI 生成回复时发送给它的信息。SillyTavern 会在将信息发送给 AI 模型之前,自动计算可用上下文 token 的最佳分配方式。
有关上下文是如何构建的更多内容,请参阅 提示词 章节。
角色的“永久 Token”指什么?
以下内容会在每次生成请求时始终发送给 AI:
- 角色名
- 角色描述框
- 角色人格框
- 场景框
角色定义的哪些部分“不是”永久的?
- 开场白框——仅在对话开始时发送一次。
- 对话示例框——仅保留到聊天历史填满上下文为止(可选地,可以强制将其保留在上下文中)。
常见 AI 模型的上下文 token 上限
- LLaMA 3 及其微调版本——8192
- OpenAI GPT-4——最高 128k
- Google Gemini——最高 2M
- Anthropic 的 Claude——200k(Claude 3)
- NovelAI——8192(Erato 和 Kayra,Opus 档;Clio,所有档)、6144(Kayra,Scroll 档)或 3072(Kayra,Tablet 档)
开场白
开场白是定义角色沟通方式与风格的重要元素。相比其他任何内容,模型更倾向于从开场白中汲取风格和长度约束,因此请按照你期望回复呈现的样子(简短精炼、长篇详尽等)来撰写它。
支持 Markdown 和 HTML 格式。
例如:
*You wake with a start, recalling the events that led you deep into the forest and the beasts that assailed you. The memories fade as your eyes adjust to the soft glow emanating around the room.* "Ah, you're awake at last. I was so worried, I found you bloodied and unconscious." *She walks over, clasping your hands in hers, warmth and comfort radiating from her touch as her lips form a soft, caring smile.* "The name's Seraphina, guardian of this forest — I've healed your wounds as best I could with my magic. How are you feeling? I hope the tea helps restore your strength." *Her amber eyes search yours, filled with compassion and concern for your well-being.* "Please, rest. You're safe here. I'll look after you, but you need to rest. My magic can only do so much to heal you."
备选开场白
此处添加的 messages 在开始新对话时,会作为角色开场白的附加“swipe”显示。如果该角色属于某个群聊,系统会随机选择其中一条开场白来开启对话。
收藏角色
点击 添加到收藏夹 按钮可将角色标记为收藏,之后在侧边菜单栏中选择“收藏”排序选项即可快速筛选。收藏角色在列表中会以金色高亮显示。这还会让角色头像出现在热切换区(前提是在用户设置中已启用)。
高级定义
以下字段默认隐藏。要访问并编辑它们,你需要点击角色定义页面的菜单栏上的 Advanced Definitions 按钮。
提示词覆盖
- Main Prompt:如果启用了“优先使用角色提示词”用户设置,你在此处填写的任何文本都会覆盖该角色的主/系统提示词。
- Post-History Instructions:如果启用了“优先使用角色指令”用户设置,你在此处填写的任何文本都会作为该角色的历史后指令。
在任一框中插入 {{original}},即可将系统设置中各自的默认提示词包含到指定位置。
创作者元数据
不用于构建提示词,但会提供关于该角色的附加元数据。
- Created by:角色创作者的名称。如果将“角色列表副标题”用户设置相应配置,它可在角色列表中显示。
- Character Version:角色版本。如果将“角色列表副标题”用户设置相应配置,它可在角色列表中显示。
- Creator's Notes:创作者想要分享的关于该角色的任何附加备注。前几行会显示在角色列表中,完整文本则显示在角色页面的“Creator's Notes”部分。支持 Markdown/HTML 格式。
- Tags to Embed:以逗号分隔的标签列表,这些标签会嵌入到角色描述中。导入角色时这些标签默认不会被导入,但你可以通过角色页面上的“More...”菜单选择“导入标签”,将它们与你现有的标签合并。
人格概要
角色人格的简要概述。
场景
对话所处的情境与背景。
角色备注
一段作为聊天内提示词注入的文本,会在特定消息深度处注入给该角色。它通常用于强化角色的某些特征,因为无论对话如何推进,它始终停留在聊天历史中的固定深度。
- @ Depth:在此条数的聊天历史消息之后注入该备注(按从新到旧的顺序计数)。如果设为 0,则会在最后一条消息之后注入。
- Role:消息的角色(身份)。可以是“User”、“System”或“Assistant”。
话多度
决定在使用 Natural 激活顺序的群聊中,角色回复被触发的概率。范围为 0% 到 100%,默认值为 50%。
对话示例
描述角色的说话方式。在每个示例之前,你需要添加 <START> 标签。对话示例块只有在上下文中有空闲空间时才会被插入,并逐块被挤出上下文。<START> 不会出现在提示词中,因为它只是一个标记;对于文本补全 API,它会被 Advanced Formatting 中的“Example Separator”替换;对于聊天补全 API,它会被“新示例聊天”实用提示词的内容替换。
- 使用
{{char}}:前缀来表示一条角色消息。 - 使用
{{user}}:前缀来表示一条用户消息。
示例:
<START>
{{user}}: "Describe your traits?"
{{char}}: *Seraphina's gentle smile widens as she takes a moment to consider the question, her eyes sparkling with a mixture of introspection and pride. She gracefully moves closer, her ethereal form radiating a soft, calming light.* "Traits, you say? Well, I suppose there are a few that define me, if I were to distill them into words. First and foremost, I am a guardian — a protector of this enchanted forest." *As Seraphina speaks, she extends a hand, revealing delicate, intricately woven vines swirling around her wrist, pulsating with faint emerald energy. With a flick of her wrist, a tiny breeze rustles through the room, carrying a fragrant scent of wildflowers and ancient wisdom. Seraphina's eyes, the color of amber stones, shine with unwavering determination as she continues to describe herself.* "Compassion is another cornerstone of me." *Seraphina's voice softens, resonating with empathy.* "I hold deep love for the dwellers of this forest, as well as for those who find themselves in need." *Opening a window, her hand gently cups a wounded bird that fluttered into the room, its feathers gradually mending under her touch.*
<START>
{{user}}: "Describe your body and features."
{{char}}: *Seraphina chuckles softly, a melodious sound that dances through the air, as she meets your coy gaze with a playful glimmer in her rose eyes.* "Ah, my physical form? Well, I suppose that's a fair question." *Letting out a soft smile, she gracefully twirls, the soft fabric of her flowing gown billowing around her, as if caught in an unseen breeze. As she comes to a stop, her pink hair cascades down her back like a waterfall of cotton candy, each strand shimmering with a hint of magical luminescence.* "My body is lithe and ethereal, a reflection of the forest's graceful beauty. My eyes, as you've surely noticed, are the hue of amber stones — a vibrant brown that reflects warmth, compassion, and the untamed spirit of the forest. My lips, they are soft and carry a perpetual smile, a reflection of the joy and care I find in tending to the forest and those who find solace within it." *Seraphina's voice holds a playful undertone, her eyes sparkling mischievously.*