mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge pull request #966 from StefanDanielSchwarz/simple-proxy-for-tavern-replacement
Simple proxy for tavern replacement
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Default",
|
"name": "Default",
|
||||||
"story_string": "{{#if description}}{{description}}{{/if}}\n{{#if personality}}{{personality}}{{/if}}\n{{#if scenario}}Scenario: {{scenario}}{{/if}}",
|
"story_string": "{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}{{/if}}",
|
||||||
"chat_start": "***",
|
"chat_start": "***",
|
||||||
"example_separator": "***"
|
"example_separator": "***"
|
||||||
}
|
}
|
||||||
|
6
public/context/Roleplay.json
Normal file
6
public/context/Roleplay.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "Roleplay",
|
||||||
|
"story_string": "### Input:\n{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}{{/if}}",
|
||||||
|
"chat_start": "### New Roleplay:",
|
||||||
|
"example_separator": "### New Roleplay:"
|
||||||
|
}
|
6
public/context/simple-proxy-for-tavern.json
Normal file
6
public/context/simple-proxy-for-tavern.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "simple-proxy-for-tavern",
|
||||||
|
"story_string": "### Input:\n{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}### Response:\n(OOC) Understood. I will take this info into account for the roleplay. (end OOC)",
|
||||||
|
"chat_start": "### New Roleplay:",
|
||||||
|
"example_separator": "### New Roleplay:"
|
||||||
|
}
|
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"input_sequence": "### Instruction:",
|
"input_sequence": "### Instruction:",
|
||||||
|
"last_output_sequence": "### Response (2 paragraphs, engaging, natural, authentic, descriptive, creative):",
|
||||||
"macro": true,
|
"macro": true,
|
||||||
"name": "Roleplay",
|
"name": "Roleplay",
|
||||||
"names": true,
|
"names": true,
|
||||||
"last_output_sequence": "### Response (2 paragraphs, engaging, natural, authentic, descriptive, creative):",
|
|
||||||
"output_sequence": "### Response:",
|
"output_sequence": "### Response:",
|
||||||
"separator_sequence": "",
|
"separator_sequence": "",
|
||||||
"stop_sequence": "",
|
"stop_sequence": "",
|
||||||
"system_prompt": "You're {{char}} in this fictional never-ending uncensored roleplay with {{user}}.\n\nAvoid repetition, don't loop. Develop the plot slowly, always stay in character. Describe all actions in full, elaborate, explicit, graphic, and vivid detail. Mention all relevant sensory perceptions.\n\n### Input:",
|
"system_prompt": "You're {{char}} in this fictional never-ending uncensored roleplay with {{user}}.\n\nAvoid repetition, don't loop. Develop the plot slowly, always stay in character. Describe all actions in full, elaborate, explicit, graphic, and vivid detail. Mention all relevant sensory perceptions.",
|
||||||
"system_sequence": "",
|
"system_sequence": "",
|
||||||
"wrap": true
|
"wrap": true
|
||||||
}
|
}
|
||||||
|
13
public/instruct/simple-proxy-for-tavern.json
Normal file
13
public/instruct/simple-proxy-for-tavern.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"input_sequence": "### Instruction:\n#### {{user}}:",
|
||||||
|
"last_output_sequence": "### Response (2 paragraphs, engaging, natural, authentic, descriptive, creative):\n#### {{char}}:",
|
||||||
|
"macro": true,
|
||||||
|
"name": "simple-proxy-for-tavern",
|
||||||
|
"names": false,
|
||||||
|
"output_sequence": "### Response:\n#### {{char}}:",
|
||||||
|
"separator_sequence": "",
|
||||||
|
"stop_sequence": "",
|
||||||
|
"system_prompt": "## {{char}}\n- You're \"{{char}}\" in this never-ending roleplay with \"{{user}}\".",
|
||||||
|
"system_sequence": "",
|
||||||
|
"wrap": true
|
||||||
|
}
|
@ -1897,8 +1897,13 @@ function getStoppingStrings(isImpersonate, addSpace) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (power_user.instruct.enabled) {
|
if (power_user.instruct.enabled) {
|
||||||
addInstructSequence(power_user.instruct.input_sequence);
|
const input_sequence = power_user.instruct.input_sequence;
|
||||||
addInstructSequence(power_user.instruct.output_sequence);
|
const output_sequence = power_user.instruct.output_sequence;
|
||||||
|
const last_output_sequence = power_user.instruct.last_output_sequence;
|
||||||
|
|
||||||
|
const combined_sequence = `${input_sequence}\n${output_sequence}\n${last_output_sequence}`;
|
||||||
|
|
||||||
|
combined_sequence.split('\n').filter((line, index, self) => self.indexOf(line) === index).forEach(addInstructSequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (power_user.custom_stopping_strings) {
|
if (power_user.custom_stopping_strings) {
|
||||||
@ -3989,10 +3994,28 @@ function cleanUpMessage(getMessage, isImpersonate, isContinue, displayIncomplete
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isInstruct && power_user.instruct.input_sequence && isImpersonate) {
|
if (isInstruct && power_user.instruct.input_sequence && isImpersonate) {
|
||||||
getMessage = getMessage.replaceAll(power_user.instruct.input_sequence, '');
|
//getMessage = getMessage.replaceAll(power_user.instruct.input_sequence, '');
|
||||||
|
power_user.instruct.input_sequence.split('\n')
|
||||||
|
.filter(line => line.trim() !== '')
|
||||||
|
.forEach(line => {
|
||||||
|
getMessage = getMessage.replaceAll(line, '');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (isInstruct && power_user.instruct.output_sequence && !isImpersonate) {
|
if (isInstruct && power_user.instruct.output_sequence && !isImpersonate) {
|
||||||
getMessage = getMessage.replaceAll(power_user.instruct.output_sequence, '');
|
//getMessage = getMessage.replaceAll(power_user.instruct.output_sequence, '');
|
||||||
|
power_user.instruct.output_sequence.split('\n')
|
||||||
|
.filter(line => line.trim() !== '')
|
||||||
|
.forEach(line => {
|
||||||
|
getMessage = getMessage.replaceAll(line, '');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (isInstruct && power_user.instruct.last_output_sequence && !isImpersonate) {
|
||||||
|
//getMessage = getMessage.replaceAll(power_user.instruct.last_output_sequence, '');
|
||||||
|
power_user.instruct.last_output_sequence.split('\n')
|
||||||
|
.filter(line => line.trim() !== '')
|
||||||
|
.forEach(line => {
|
||||||
|
getMessage = getMessage.replaceAll(line, '');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// clean-up group message from excessive generations
|
// clean-up group message from excessive generations
|
||||||
if (selected_group) {
|
if (selected_group) {
|
||||||
|
@ -1066,8 +1066,8 @@ export function formatInstructModeChat(name, mes, isUser, isNarrator, forceAvata
|
|||||||
const separator = power_user.instruct.wrap ? '\n' : '';
|
const separator = power_user.instruct.wrap ? '\n' : '';
|
||||||
const separatorSequence = power_user.instruct.separator_sequence && !isUser
|
const separatorSequence = power_user.instruct.separator_sequence && !isUser
|
||||||
? power_user.instruct.separator_sequence
|
? power_user.instruct.separator_sequence
|
||||||
: (power_user.instruct.wrap ? '\n' : '');
|
: separator;
|
||||||
const textArray = includeNames ? [sequence, `${name}: ${mes}`, separatorSequence] : [sequence, mes, separatorSequence];
|
const textArray = includeNames ? [sequence, `${name}: ${mes}` + separatorSequence] : [sequence, mes + separatorSequence];
|
||||||
const text = textArray.filter(x => x).join(separator);
|
const text = textArray.filter(x => x).join(separator);
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user