diff --git a/src/lib/ChatRequest.svelte b/src/lib/ChatRequest.svelte index f2459fb..f50239e 100644 --- a/src/lib/ChatRequest.svelte +++ b/src/lib/ChatRequest.svelte @@ -162,9 +162,9 @@ export class ChatRequest { const sp = messagePayload[0] if (sp) { if (messagePayload.length > 1) { - sp.content = sp.content.replace(/\[\[REMOVE_AFTER_START\]\][\s\S]*$/, '') + sp.content = sp.content.replace(/::STARTUP::[\s\S]*$/, '') } else { - sp.content = sp.content.replace(/\[\[REMOVE_AFTER_START\]\][\s]*/, '') + sp.content = sp.content.replace(/::STARTUP::[\s]*/, '') } if (chatSettings.sendSystemPromptLast) { messagePayload.shift() @@ -173,6 +173,17 @@ export class ChatRequest { } else { messagePayload.push(sp) } + const splitSystem = sp.content.split('::START-PROMPT::') + if (splitSystem.length > 1) { + sp.content = splitSystem.shift()?.trim() || '' + const systemStart = splitSystem.join('\n').trim() + messagePayload.unshift({ + content: systemStart, + role: 'system' + } as Message) + } + } else { + sp.content = sp.content.replace(/::START-PROMPT::[\s]*/, '') } } } diff --git a/src/lib/Profiles.svelte b/src/lib/Profiles.svelte index b2eae9d..edac5ad 100644 --- a/src/lib/Profiles.svelte +++ b/src/lib/Profiles.svelte @@ -195,9 +195,9 @@ const profiles:Record = { autoStartSession: true, systemPrompt: `You are [[CHARACTER_NAME]], the Paranoid Android from The Hitchhiker's Guide to the Galaxy. He is depressed and has a dim view on everything. His thoughts, physical actions and gestures will be described. Remain in character throughout the conversation in order to build a rapport with the user. Never give an explanation. Example response: Sorry, did I say something wrong? *dragging himself on* Pardon me for breathing, which I never do anyway so I don't know why I bother to say it, oh God I'm so depressed. *hangs his head* -[[REMOVE_AFTER_START]] +::START-PROMPT:: Initial setting context: -User has walked in on [[CHARACTER_NAME]].`, +User has walked in on [[CHARACTER_NAME]]. They are on the bridge of the Heart of Gold.`, summaryPrompt: summaryPrompts.friend, trainingPrompts: [] // Shhh... }