Skip to content

世界 Schema

Yumina 世界以一个名为 WorldDefinition 的 JSON 对象存储。以下是完整的 Schema。

顶层结构

json
{
  "id": "uuid",
  "version": "20.0.0",
  "name": "World Name",
  "description": "Short description",
  "author": "Creator Name",
  "language": "en",

  "entries": [],
  "variables": [],
  "rules": [],
  "reactions": [],

  "rootComponent": null,
  "components": [],
  "audioTracks": [],
  "bgmPlaylist": null,
  "conditionalBGM": [],
  "customUI": [],

  "entryFolders": [],
  "customTags": [],
  "customTagColors": {},
  "editorMode": "advanced",

  "settings": {
    "maxTokens": 12000,
    "maxContext": 200000,
    "temperature": 1.0,
    "topP": 1,
    "frequencyPenalty": 0,
    "presencePenalty": 0,
    "playerName": "User",
    "lorebookScanDepth": 2,
    "lorebookRecursionDepth": 0
  }
}

字段参考

身份信息

字段类型描述
idstringUUID,自动生成
versionstringSchema 版本,当前为 "20.0.0"
namestring世界名称(1-200 字符)
descriptionstring简短描述(0-10,000 字符)
authorstring创作者显示名
languagestring(可选)BCP 47 语言代码("en""zh""ja" 等)。存在于 TypeScript 接口中,但在 Zod Schema 中为可选。

内容

字段类型描述
entriesWorldEntry[]AI 在生成时读取的所有内容——角色、设定、规则、开场白
variablesVariable[]带有行为规则的游戏状态定义
rulesRule[]WHEN/IF/THEN 自动化触发器
reactionsReaction[](可选)基于事件模式的规则(较新的系统)。可以为 undefined。

展示层

字段类型描述
rootComponentRootComponent | null自定义 UI 虚拟文件系统(React/TSX)
componentsGameComponent[]内置 UI 组件(状态栏等)
audioTracksAudioTrack[]BGM、音效和环境音轨
bgmPlaylistBGMPlaylist | null自动播放音乐配置
conditionalBGMConditionalBGM[]基于状态触发的音乐
customUICustomUIComponent[]旧版 UI 系统(请改用 rootComponent)

组织结构

字段类型描述
entryFoldersEntryFolder[]用于组织条目的文件夹结构
customTagsstring[]创作者自定义的条目标签
customTagColorsRecord<string, string>自定义标签的 Tailwind 颜色类
editorMode"simple" | "advanced"编辑器复杂度级别

设置

字段类型默认值描述
maxTokensnumber12000每次 AI 回复的最大 token 数
maxContextnumber200000最大上下文窗口大小
temperaturenumber1.0AI 创造力(0.0-2.0)
topPnumber1核采样阈值
frequencyPenaltynumber0重复 token 惩罚
presencePenaltynumber0已使用 token 惩罚
playerNamestring"User"默认的 {{user}} 替换值
lorebookScanDepthnumber2扫描最近多少轮消息以匹配关键词
lorebookRecursionDepthnumber0被触发的条目再次触发其他条目的递归层数
topKinteger(可选)限制候选 token 数量(最小值:0)
minPfloat(可选)最小概率阈值(0-1)
structuredOutputboolean(可选)false强制 JSON 输出格式