角色设计
角色名称是唯一必填字段。您可以将其余部分留空,并在聊天中仍然使用角色。
角色说明
用于添加AI的角色描述和其他相关信息。此信息始终包含在提示词中,因此所有重要事实均应包含在此处。
例如,您可以添加有关动作发生的世界的信息,描述角色的外观、个性和背景。
它可以是任何长度(200 或 2000 token)并以任何样式(自由文本、伪代码对话样式等)格式化。
方法和格式
角色格式化方法是一个复杂的主题,超出了本文档页面的范围。
使用或依赖 SillyTavern 功能进行测试的推荐指南:
- Trappu 的 PLists + Ali:Chat 指南: https://wikia.schneedc.com/bot-creation/trappu/creation
- AliCat的阿里:聊天指南: https://rentry.co/alichat
- kingbri的简约指南: https://rentry.co/kingbri-chara-guide
角色 token
TL;DR:如果您使用的 AI 模型具有 2048 个上下文 token 限制,则 1000-token 角色定义会将 AI 的“内存”减半。
从长远来看,一个好的 AI 的良好响应很容易在 200-300 token 左右。在这种情况下,人工智能只能“记住”大约 3 次聊天记录。
为什么我的角色的 token 计数器变成红色?
当我们看到您的角色的定义中模型定义的上下文长度超过 token 的一半时,我们会为您突出显示它,因为这会降低 AI 提供愉快对话的能力。
如果我的角色有太多 token 会怎样?
别担心——它不会破坏任何东西。在最坏的情况下,如果角色的永久 token 太大,这仅仅意味着上下文中留给其他东西的空间会更少(见下文)。
这可能产生的唯一负面影响是人工智能的“内存”会减少,因为可供处理的聊天历史记录会减少。
这是因为每个人工智能模型一次可以处理的上下文数量都有限制。
“背景”?
这是每次您要求人工智能生成响应时发送给人工智能的信息。在将信息发送到 AI 模型之前,SillyTavern 会自动计算分配可用上下文 token 的最佳方式。
阅读有关如何在中构建上下文的更多信息 提示词 部分。
角色的“永久 Token”是什么?
这些将始终随着每次生成请求发送到 AI:
- 角色名称
- 角色说明盒
- 角色个性盒
- 场景盒
角色定义的哪些部分不是永久性的?
- 第一个消息框 - 仅在聊天开始时发送一次。
- 示例消息框 - 仅保留到聊天历史记录填满上下文为止(可选地,可以强制将它们保留在上下文中)
流行的人工智能模型上下文令牌限制
- LLaMA 3 及其微调 - 8192
- OpenAI GPT-4 - 高达 128k
- Google Gemini - 高达 2M
- Anthropic 的克劳德 - 200k (克劳德 3)
- NovelAI - 8192(Erato 和 Kayra,Opus 层;Clio,所有层)、6144(Kayra,Scroll 层)或 3072(Kayra,平板电脑层)
第一条消息
第一条消息是定义角色通信方式和风格的重要元素。该模型更有可能从第一条消息中获取样式和长度约束,因此以您希望的响应方式编写它很重要(简短、简洁、长而详细等)。
支持 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."
备用问候语
开始新聊天时,此处添加的消息将显示为角色的第一条消息的附加“滑动切换回复”。如果角色是群聊的一部分,系统会随机选择其中一条问候语来发起对话。
收藏角色
单击 添加到收藏夹 按钮将角色标记为收藏夹,通过选择“收藏夹”排序选项在侧面菜单栏上快速过滤它们。最喜欢的角色在列表中有金色亮点。这也将使角色肖像出现在热插拔区域中(如果在用户设置中启用)。
高级定义
默认情况下隐藏以下字段。要访问和编辑它们,您需要单击 高级定义 角色定义页面菜单栏上的按钮。
提示词覆盖
- 主提示词:如果启用了“首选字符提示词”用户设置,则您在此处输入的任何文本都将覆盖 主/系统提示词 对于角色。
- 历史后指令:如果启用了“首选字符说明”用户设置,则您在此处输入的任何文本都将用作 后历史指示 对于角色。
插入
{{original}}进入任一框中,以将系统设置中的相应默认提示词包含在指定位置。
创作者元数据
不用于提示词构建,但提供有关角色的附加元数据。
- 创建者::角色的创建者的名字。如果相应地设置了“字符列表子标题”用户设置,则可以显示在角色列表中。
- 角色版本:角色的版本。如果相应地设置了“字符列表子标题”用户设置,则可以显示在角色列表中。
- 创作者笔记:创建者想要分享的有关角色的任何其他注释。前几行显示在角色列表中,全文显示在角色页面的“创建者注释”部分中。支持 Markdown/HTML 格式。
- 要嵌入的标签:以逗号分隔的标签列表,将嵌入角色的描述中。导入角色时,默认情况下不会导入这些标签,但您可以通过从角色页面的“更多...”菜单中选择“导入标签”,将它们与现有标签合并。
性格总结
简单总结一下角色的个性。
场景
对话的情况和背景。
角色的备注
用作特定消息深度的角色的聊天内提示词注入的文本。它通常用于强化某些角色特征,因为它始终保持在聊天历史记录中的静态深度,无论其进展如何。
- @深度:聊天记录中的消息数,之后将注入此注释(按从最新到最旧的顺序)。如果设置为 0,它将在最后一条消息之后注入。
- 角色:消息的作用。可以是“用户”、“系统”或“助理”。
健谈
决定使用群聊时角色的响应被触发的概率 自然 激活命令。范围从 0% 到 100%,默认值为 50%。
对话示例
描述角色如何说话。在每个示例之前,您需要添加 <START> 标签。仅当上下文中存在可用空间时才插入示例对话块,并逐块地将其推出上下文之外。 <START> 不会出现在提示词中,因为它只是一个标记;它将替换为文本补全 API 的高级格式化中的“示例分隔符”以及聊天补全 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.*