feat: complete WorkBuddy parity and Windows release workflow
This commit is contained in:
1 parent
143516b3a8
commit
d5512df549
434 files changed
+54977
-1854
No files matched your search
@@ -94,10 +94,13 @@ function clipped(value: string): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* 拼出每轮附加的个性化上下文(随该轮用户消息一起发送)。默认值(空身份、默认风格、未编辑的人设)不产生多余内容,
|
||||
* 避免把原版默认人设重复注入每轮上下文;用户自定义后才进入提示词。
|
||||
* 拼出每轮附加的个性化上下文(随该轮用户消息一起发送)。
|
||||
* 人设区块始终反映当前生效文本,包括 UI 中显示的默认人设。
|
||||
*/
|
||||
export function buildPersonalizationPrompt(settings: PersonalizationSettings): string {
|
||||
export function buildPersonalizationPrompt(
|
||||
settings: PersonalizationSettings,
|
||||
options: { includeLongTermMemory?: boolean } = {}
|
||||
): string {
|
||||
const lines: string[] = []
|
||||
if (settings.userCallName) lines.push(`- 用户希望被称呼为:${settings.userCallName}`)
|
||||
if (settings.aiName) lines.push(`- 你的名字是:${settings.aiName};自我介绍时使用这个名字。`)
|
||||
@@ -106,9 +109,8 @@ export function buildPersonalizationPrompt(settings: PersonalizationSettings): s
|
||||
const customPrompt = clipped(settings.customPrompt)
|
||||
if (customPrompt) lines.push('### 用户指令', customPrompt)
|
||||
const persona = clipped(settings.persona)
|
||||
const defaultPersona = clipped(DEFAULT_PERSONA)
|
||||
if (persona && persona !== defaultPersona) lines.push('### 人设设定', persona)
|
||||
const memory = clipped(settings.longTermMemory)
|
||||
if (persona) lines.push('### 人设设定', persona)
|
||||
const memory = options.includeLongTermMemory === false ? '' : clipped(settings.longTermMemory)
|
||||
if (memory) lines.push('### 长期记忆', memory)
|
||||
return lines.length ? ['## 个性化偏好(用户设置,始终遵守)', ...lines].join('\n') : ''
|
||||
}
|
||||
Reference in new issue
Block a user