叙事设计键
本指南展示如何动态传递变量到叙事设计部分和触发器

Narrative Design 键
最后更新于
这有帮助吗?
这有帮助吗?
//示例
function getNarrativeTemplateKeys(): Map<string, string> {
const narrativeKeys = new Map<string, string>();
// 用叙事键和值填充映射
// 这可以来自数据库、配置文件或其他来源
narrativeKeys.set('TimeOfDay', '将其替换为时间');
narrativeKeys.set('chapter1', '旅程始于一个小村庄。');
// 根据需要添加更多叙事键
return narrativeKeys;
}
const client = new convaiClient({
apiKey: 'your-api-key',
characterId: '你的角色ID',
narrativeTemplateKeys: getNarrativeTemplateKeys()
});