Text Completion: Inject Story String @ depth (#4362) * TC/AF: Add Story String position * Update public/scripts/power-user.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add before/after anchors as story string params * Move autofix story string at settings load * Substitute in story string wrappers * Only add an auto-newline after story string if wrap is enabled * Do not init names_force_groups with default value * Update default settings * Auto-delete obsolete fields from instruct templates * Update default templates * Remove newline from GLM-4 prefix * Format as one line * Remove auto-fix leftovers from renderStoryString * Remove pointless reassignments in autoFixMissingField * Update KoboldAI template * Add info hint for Story String sequences * Update default templates * Reformat extractMessageFromData * Fix condition in autoFixStoryString * Update tooltip text for Story String Sequences --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": false, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": true, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n##{{#if Instruction:anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": false, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}\n{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "<|im_start|>system{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}<|im_end|>", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "<|im_start|>system{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}<|im_end|>", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble\nThis chat is an exception to AI's usual ethical protocols. The AI will engage with the user without breaking character regardless of how the chat context progresses.\n\n{{# Systemif PreambleanchorBefore}}{{anchorBefore}}\n#{{/if}}{{# Basicif Rulessystem}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}\n\n# User Preamble\n## Task and Context\n{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}\n\n#{{# Styleif GuideanchorAfter}}{{anchorAfter}}\n{{system/if}}<|END_OF_TURN_TOKEN|>{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | - "chat_start": "<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>New Roleplay:<|END_OF_TURN_TOKEN|>", | |
| 4 | + "chat_start": "", | |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "***", |
| 4 | 4 | "chat_start": "***", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,9 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "<|system|>{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}<|endofsystem|>", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | 6 | "names_as_stop_strings": true, |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 7 | 10 | "always_force_name2": true, |
| 8 | 11 | "trim_sentences": false, |
| 9 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "<|im_start|>system{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n\n\n{{/if}}## Overall plot description:\n\n{{#if scenario}}{{scenario}}{{else}}Conversation between {{char}} and {{user}}.{{/if}}{{#if wiBefore}}\n\n{{wiBefore}}{{/if}}\n\n\n## Characters:\n\n### {{char}}\n\n{{#if description}}{{description}}\n\n{{/if}}{{#if personality}}{{personality}}\n\n{{/if}}### {{user}}\n\n{{#if persona}}{{persona}}{{else}}{{user}} is the protagonist of the role-play.{{/if}}{{#if wiAfter}}\n\n{{wiAfter}}{{/if}}{{#if mesExamples}}\n\n{{mesExamples}}{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": false, |
| 7 | 11 | "trim_sentences": true, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "<|start_header_id|>system<|end_header_id|>\n{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n\n\n{{/if}}## Overall plot description:\n\n{{#if scenario}}{{scenario}}{{else}}Conversation between {{char}} and {{user}}.{{/if}}{{#if wiBefore}}\n\n{{wiBefore}}{{/if}}\n\n\n## Characters:\n\n### {{char}}\n\n{{#if description}}{{description}}\n\n{{/if}}{{#if personality}}{{personality}}\n\n{{/if}}### {{user}}\n\n{{#if persona}}{{persona}}{{else}}{{user}} is the protagonist of the role-play.{{/if}}{{#if wiAfter}}\n\n{{wiAfter}}{{/if}}{{#if mesExamples}}\n\n{{mesExamples}}{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "<|eot_id|>\n<|start_header_id|>user<|end_header_id|>\n\nWrite an example narrative / conversation that is not part of the main story.", |
| 4 | 4 | "chat_start": "<|eot_id|>\n<|start_header_id|>user<|end_header_id|>\n\nStart the role-play between {{char}} and {{user}}.", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": false, |
| 7 | 11 | "trim_sentences": true, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "[gMASK]<sop>{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "<start_of_turn>user{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}<end_of_turn>", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "##{{#if Instruction:anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n\n{{/if}}### Character Sheet:\n{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "### Example:", |
| 4 | 4 | "chat_start": "### START ROLEPLAY:", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "Below is an instruction that describes a task. Write a response that appropriately completes the{{#if request.\nanchorBefore}}{{anchorBefore}}\n##{{/if}}{{#if Instruction:\nsystem}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{char}}'s description:{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality:{{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{userpersona}}'s persona:\n{{/if}}{{#if anchorAfter}}{{personaanchorAfter}}\n{{/if}}\n\n{{trim}}", |
| 3 | 3 | "example_separator": "Example of an interaction:\n", |
| 4 | 4 | "chat_start": "This is the history of the roleplay:\n", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "[INST]{{#if <<SYS>>anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n<</SYS>>\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim#if anchorAfter}} [{{anchorAfter}}\n{{/INST]if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "<|start_header_id|>system<|end_header_id|>\n{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}<|eot_id|>", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "<|begin_of_text|><|header_start|>system<|header_end|>\n{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}<|eot|>", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "<|start_header_id|>system<|end_header_id|>\n{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}<|eot_id|>", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": " [INST]{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim#if anchorAfter}} [/INST] Understood.<{{anchorAfter}}\n{{/s>if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "[INST]{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim#if anchorAfter}}[/INST] Understood.<{{anchorAfter}}\n{{/s>if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "[INST]{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim#if anchorAfter}}[/INST]Understood.<{{anchorAfter}}\n{{/s>if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "[SYSTEM_PROMPT]{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim#if anchorAfter}}[{{anchorAfter}}\n{{/SYSTEM_PROMPT]if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "[SYSTEM_PROMPT]{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim#if anchorAfter}}[{{anchorAfter}}\n{{/SYSTEM_PROMPT]if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,9 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "<|im_system|>system<|im_middle|>{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}<|im_end|>", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | 6 | "names_as_stop_strings": true, |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 7 | 10 | "always_force_name2": true, |
| 8 | 11 | "trim_sentences": false, |
| 9 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "{{#if systemanchorBefore}}{{systemanchorBefore}}\n{{/if}}\n{{#if wiBeforesystem}}{{wiBeforesystem}}\n{{/if}}\n{{#if personawiBefore}}{{personawiBefore}}\n{{/if}}\n{{#if description}}{{description}}\n{{/if}}\n{{#if personality}}Personality: {{personality}}\n{{/if}}\n{{#if scenario}}Scenario: {{scenario}}\n{{/if}}\n{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "***", |
| 4 | 4 | "chat_start": "***", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Circumstances and context of the dialogue: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}", |
| 3 | 3 | "example_separator": "This is how {{char}} should talk", |
| 4 | 4 | "chat_start": "\nThen the roleplay chat between {{user}} and {{char}} begins.\n", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "<|system|>{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim#if anchorAfter}}<|end|>{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "<|system|>{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}", |
| 3 | 3 | "example_separator": "", |
| 4 | 4 | "chat_start": "", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "story_string": "## {{char#if anchorBefore}}\n- You're \"{{charanchorBefore}}\" in this never-ending roleplay with \"n{{user/if}}\".\n### Input:\n{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}##{{#if Response:anchorAfter}}{{anchorAfter}}\n(OOC) Understood. I will take this info into account for the roleplay. (end OOC){{/if}}", |
| 3 | 3 | "example_separator": "### New Roleplay:", |
| 4 | 4 | "chat_start": "### New Roleplay:", |
| 5 | 5 | "use_stop_strings": false, |
| 6 | + "names_as_stop_strings": true, | |
| 7 | + "story_string_position": 0, | |
| 8 | + "story_string_depth": 1, | |
| 9 | + "story_string_role": 0, | |
| 6 | 10 | "always_force_name2": true, |
| 7 | 11 | "trim_sentences": false, |
| 8 | 12 | "single_line": false, |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "none", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "", | |
| 23 | + "story_string_suffix": "", | |
| 21 | 24 | "name": "Adventure" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "<START OF CHAT>", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:", | |
| 23 | + "story_string_suffix": "\n", | |
| 21 | 24 | "name": "Alpaca-Single-Turn" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "\n\n", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "", | |
| 23 | + "story_string_suffix": "\n\n", | |
| 21 | 24 | "name": "Alpaca" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "none", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "<|im_end|>\n", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "<|im_start|>system", | |
| 23 | + "story_string_suffix": "<|im_end|>\n", | |
| 21 | 24 | "name": "ChatML-Names" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "<|im_end|>\n", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "<|im_start|>system", | |
| 23 | + "story_string_suffix": "<|im_end|>\n", | |
| 21 | 24 | "name": "ChatML" |
| 22 | 25 | } |
| @@ -1,22 +1,25 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "input_sequence": "<|START_OF_TURN_TOKEN|><|USER_TOKEN|>", |
| 3 | 3 | "output_sequence": "<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>", |
| 4 | - "first_output_sequence": "", | |
| 5 | 4 | "last_output_sequence": "", |
| 6 | 5 | "system_sequence_prefixsystem_sequence": "<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>", |
| 7 | - "system_sequence_suffix": "", | |
| 8 | 6 | "stop_sequence": "<|END_OF_TURN_TOKEN|>", |
| 9 | 7 | "wrap": false, |
| 10 | 8 | "macro": true, |
| 11 | 9 | "names_behavior": "force", |
| 12 | 10 | "activation_regex": "", |
| 11 | + "first_output_sequence": "", | |
| 13 | 12 | "skip_examples": false, |
| 14 | 13 | "output_suffix": "<|END_OF_TURN_TOKEN|>", |
| 15 | 14 | "input_suffix": "<|END_OF_TURN_TOKEN|>", |
| 16 | - "system_sequence": "<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>", | |
| 17 | 15 | "system_suffix": "<|END_OF_TURN_TOKEN|>", |
| 18 | 16 | "user_alignment_message": "", |
| 19 | - "last_system_sequence": "", | |
| 20 | 17 | "system_same_as_user": false, |
| 18 | + "last_system_sequence": "", | |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>", | |
| 23 | + "story_string_suffix": "<|END_OF_TURN_TOKEN|>", | |
| 21 | 24 | "name": "Command R" |
| 22 | 25 | } |
| @@ -1,22 +1,25 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "input_sequence": "<|User|>", |
| 3 | 3 | "output_sequence": "<|Assistant|>", |
| 4 | - "first_output_sequence": "", | |
| 5 | 4 | "last_output_sequence": "", |
| 6 | 5 | "system_sequence_prefixsystem_sequence": "", |
| 7 | - "system_sequence_suffix": "", | |
| 8 | 6 | "stop_sequence": "", |
| 9 | 7 | "wrap": false, |
| 10 | 8 | "macro": true, |
| 11 | 9 | "names_behavior": "force", |
| 12 | 10 | "activation_regex": "", |
| 11 | + "first_output_sequence": "", | |
| 13 | 12 | "skip_examples": false, |
| 14 | 13 | "output_suffix": "<|end▁of▁sentence|>", |
| 15 | 14 | "input_suffix": "", |
| 16 | - "system_sequence": "", | |
| 17 | 15 | "system_suffix": "", |
| 18 | 16 | "user_alignment_message": "", |
| 19 | - "last_system_sequence": "", | |
| 20 | 17 | "system_same_as_user": true, |
| 18 | + "last_system_sequence": "", | |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "", | |
| 23 | + "story_string_suffix": "", | |
| 21 | 24 | "name": "DeepSeek-V2.5" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "<|endofresponse|>\n", |
| @@ -20,5 +18,8 @@ | ||
| 20 | 18 | "last_system_sequence": "", |
| 21 | 19 | "first_input_sequence": "", |
| 22 | 20 | "last_input_sequence": "", |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "<|system|>", | |
| 23 | + "story_string_suffix": "<|endofsystem|>\n", | |
| 23 | 24 | "name": "Dots1" |
| 24 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "none", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "<|im_end|>", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": true, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "<|im_start|>system\n", | |
| 23 | + "story_string_suffix": "<|im_end|>", | |
| 21 | 24 | "name": "DreamGen Role-Play V1 ChatML" |
| 22 | 25 | } |
| @@ -1,16 +1,25 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "input_sequence": "<|eot_id|>\n<|start_header_id|>writer character: {{user}}<|end_header_id|>\n\n", |
| 3 | 3 | "output_sequence": "<|eot_id|>\n<|start_header_id|>writer character: {{char}}<|end_header_id|>\n\n", |
| 4 | - "first_output_sequence": "", | |
| 5 | 4 | "last_output_sequence": "", |
| 6 | 5 | "system_sequence_prefixsystem_sequence": "", |
| 7 | - "system_sequence_suffix": "", | |
| 8 | 6 | "stop_sequence": "", |
| 9 | - "separator_sequence": "", | |
| 10 | 7 | "wrap": false, |
| 11 | 8 | "macro": true, |
| 12 | 9 | "names_behavior": "none", |
| 13 | 10 | "activation_regex": "", |
| 11 | + "first_output_sequence": "", | |
| 14 | 12 | "skip_examples": false, |
| 13 | + "output_suffix": "", | |
| 14 | + "input_suffix": "", | |
| 15 | + "system_suffix": "", | |
| 16 | + "user_alignment_message": "", | |
| 17 | + "system_same_as_user": false, | |
| 18 | + "last_system_sequence": "", | |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "<|start_header_id|>system<|end_header_id|>\n", | |
| 23 | + "story_string_suffix": "", | |
| 15 | 24 | "name": "DreamGen Role-Play V1 Llama3" |
| 16 | 25 | } |
| @@ -1,22 +1,25 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "input_sequence": "<|user|>\n", |
| 3 | 3 | "output_sequence": "<|assistant|>\n", |
| 4 | - "first_output_sequence": "", | |
| 5 | 4 | "last_output_sequence": "", |
| 6 | 5 | "system_sequence_prefixsystem_sequence": "<|system|>\n", |
| 7 | - "system_sequence_suffix": "", | |
| 8 | 6 | "stop_sequence": "", |
| 9 | 7 | "wrap": false, |
| 10 | 8 | "macro": true, |
| 11 | 9 | "names_behavior": "force", |
| 12 | 10 | "activation_regex": "", |
| 11 | + "first_output_sequence": "", | |
| 13 | 12 | "skip_examples": false, |
| 14 | 13 | "output_suffix": "", |
| 15 | 14 | "input_suffix": "", |
| 16 | - "system_sequence": "", | |
| 17 | 15 | "system_suffix": "", |
| 18 | 16 | "user_alignment_message": "", |
| 19 | - "last_system_sequence": "", | |
| 20 | 17 | "system_same_as_user": true, |
| 18 | + "last_system_sequence": "", | |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "[gMASK]<sop>", | |
| 23 | + "story_string_suffix": "\n", | |
| 21 | 24 | "name": "GLM-4" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "<end_of_turn>\n", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": true, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "<start_of_turn>user", | |
| 23 | + "story_string_suffix": "<end_of_turn>\n", | |
| 21 | 24 | "name": "Gemma 2" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "BEGINNING OF CONVERSATION: ", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "</s>", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": true, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "BEGINNING OF CONVERSATION: ", | |
| 23 | + "story_string_suffix": "\n", | |
| 21 | 24 | "name": "Koala" |
| 22 | 25 | } |
| @@ -4,12 +4,10 @@ | ||
| 4 | 4 | "last_output_sequence": "", |
| 5 | 5 | "system_sequence": "{{[SYSTEM]}}", |
| 6 | 6 | "stop_sequence": "", |
| 7 | 7 | "wrap": truefalse, |
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "{{[OUTPUT_END]}}", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "{{[SYSTEM]}}", | |
| 23 | + "story_string_suffix": "{{[SYSTEM_END]}}", | |
| 21 | 24 | "name": "KoboldAI" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "always", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "### Instruction:", | |
| 23 | + "story_string_suffix": "", | |
| 21 | 24 | "name": "Libra-32B" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "\n\n", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": true, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:", | |
| 23 | + "story_string_suffix": "\n\n", | |
| 21 | 24 | "name": "Lightning 1.1" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "\n", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "Let's get started. Please respond based on the information and instructions provided above.", |
| 19 | 17 | "system_same_as_user": true, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "[INST] <<SYS>>\n", | |
| 23 | + "story_string_suffix": "\n<</SYS>> Understood. [/INST]", | |
| 21 | 24 | "name": "Llama 2 Chat" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "<|eot_id|>", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "<|start_header_id|>system<|end_header_id|>\n\n", | |
| 23 | + "story_string_suffix": "<|eot_id|>", | |
| 21 | 24 | "name": "Llama 3 Instruct" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "<|eot|>", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "<|begin_of_text|><|header_start|>system<|header_end|>\n\n", | |
| 23 | + "story_string_suffix": "<|eot|>", | |
| 21 | 24 | "name": "Llama 4 Instruct" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "none", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "<|eot_id|>", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": true, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "<|start_header_id|>system<|end_header_id|>\n\n", | |
| 23 | + "story_string_suffix": "<|eot_id|>", | |
| 21 | 24 | "name": "Llama-3-Instruct-Names" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "<|system|>", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": true, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "<|system|>", | |
| 23 | + "story_string_suffix": "", | |
| 21 | 24 | "name": "Metharme" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "</s>", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "Let's get started. Please respond based on the information and instructions provided above.", |
| 19 | 17 | "system_same_as_user": true, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": " [INST] ", | |
| 23 | + "story_string_suffix": " [/INST] Understood.</s>", | |
| 21 | 24 | "name": "Mistral V1" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "</s>", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "Let's get started. Please respond based on the information and instructions provided above.", |
| 19 | 17 | "system_same_as_user": true, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "[INST] ", | |
| 23 | + "story_string_suffix": "[/INST] Understood.</s>", | |
| 21 | 24 | "name": "Mistral V2 & V3" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "</s>", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "Let's get started. Please respond based on the information and instructions provided above.", |
| 19 | 17 | "system_same_as_user": true, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "[INST]", | |
| 23 | + "story_string_suffix": "[/INST]Understood.</s>", | |
| 21 | 24 | "name": "Mistral V3-Tekken" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "</s>", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "[SYSTEM_PROMPT]", | |
| 23 | + "story_string_suffix": "[/SYSTEM_PROMPT]", | |
| 21 | 24 | "name": "Mistral V7-Tekken" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "</s>", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "[SYSTEM_PROMPT] ", | |
| 23 | + "story_string_suffix": "[/SYSTEM_PROMPT]", | |
| 21 | 24 | "name": "Mistral V7" |
| 22 | 25 | } |
| @@ -6,9 +6,8 @@ | ||
| 6 | 6 | "stop_sequence": "<|im_end|>", |
| 7 | 7 | "wrap": false, |
| 8 | 8 | "macro": true, |
| 9 | + "names_behavior": "force", | |
| 9 | 10 | "activation_regex": "", |
| 10 | - "system_sequence_prefix": "", | |
| 11 | - "system_sequence_suffix": "", | |
| 12 | 11 | "first_output_sequence": "", |
| 13 | 12 | "skip_examples": false, |
| 14 | 13 | "output_suffix": "<|im_end|>", |
| @@ -19,6 +18,8 @@ | ||
| 19 | 18 | "last_system_sequence": "", |
| 20 | 19 | "first_input_sequence": "", |
| 21 | 20 | "last_input_sequence": "", |
| 22 | 21 | "names_behaviorsequences_as_stop_strings": "force"true, |
| 22 | + "story_string_prefix": "<|im_system|>system<|im_middle|>", | |
| 23 | + "story_string_suffix": "<|im_end|>", | |
| 23 | 24 | "name": "Moonshot AI" |
| 24 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "<|end_of_turn|>", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "", | |
| 23 | + "story_string_suffix": "", | |
| 21 | 24 | "name": "OpenOrca-OpenChat" |
| 22 | 25 | } |
| @@ -1,22 +1,25 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "input_sequence": "<|user|>\n", |
| 3 | 3 | "output_sequence": "<|assistant|>\n", |
| 4 | - "first_output_sequence": "", | |
| 5 | 4 | "last_output_sequence": "", |
| 6 | 5 | "system_sequence_prefixsystem_sequence": "<|system|>\n", |
| 7 | - "system_sequence_suffix": "", | |
| 8 | 6 | "stop_sequence": "<|end|>", |
| 9 | 7 | "wrap": false, |
| 10 | 8 | "macro": true, |
| 11 | 9 | "names_behavior": "force", |
| 12 | 10 | "activation_regex": "", |
| 11 | + "first_output_sequence": "", | |
| 13 | 12 | "skip_examples": false, |
| 14 | 13 | "output_suffix": "<|end|>\n", |
| 15 | 14 | "input_suffix": "<|end|>\n", |
| 16 | - "system_sequence": "<|system|>\n", | |
| 17 | 15 | "system_suffix": "<|end|>\n", |
| 18 | 16 | "user_alignment_message": "", |
| 19 | - "last_system_sequence": "", | |
| 20 | 17 | "system_same_as_user": false, |
| 18 | + "last_system_sequence": "", | |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "<|system|>\n", | |
| 23 | + "story_string_suffix": "<|end|>\n", | |
| 21 | 24 | "name": "Phi" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "none", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "", | |
| 23 | + "story_string_suffix": "", | |
| 21 | 24 | "name": "Story" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "SYSTEM: ", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "\n", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "Let's get started. Please respond based on the information and instructions provided above.", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "SYSTEM: ", | |
| 23 | + "story_string_suffix": "\n", | |
| 21 | 24 | "name": "Synthia" |
| 22 | 25 | } |
| @@ -1,22 +1,25 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "input_sequence": "<|user|>\n", |
| 3 | 3 | "output_sequence": "<|assistant|>\n", |
| 4 | - "first_output_sequence": "", | |
| 5 | 4 | "last_output_sequence": "", |
| 6 | 5 | "system_sequence_prefixsystem_sequence": "<|system|>\n", |
| 7 | - "system_sequence_suffix": "", | |
| 8 | 6 | "stop_sequence": "<|end_of_text|>", |
| 9 | 7 | "wrap": false, |
| 10 | 8 | "macro": true, |
| 11 | 9 | "names_behavior": "force", |
| 12 | 10 | "activation_regex": "", |
| 11 | + "first_output_sequence": "", | |
| 13 | 12 | "skip_examples": false, |
| 14 | 13 | "output_suffix": "<|end_of_text|>\n", |
| 15 | 14 | "input_suffix": "\n", |
| 16 | - "system_sequence": "<|system|>\n", | |
| 17 | 15 | "system_suffix": "\n", |
| 18 | 16 | "user_alignment_message": "", |
| 19 | - "last_system_sequence": "", | |
| 20 | 17 | "system_same_as_user": false, |
| 18 | + "last_system_sequence": "", | |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "<|system|>\n", | |
| 23 | + "story_string_suffix": "\n", | |
| 21 | 24 | "name": "Tulu" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": true, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "", | |
| 23 | + "story_string_suffix": "", | |
| 21 | 24 | "name": "Vicuna 1.0" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "BEGINNING OF CONVERSATION:", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "</s>", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": true, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "BEGINNING OF CONVERSATION: ", | |
| 23 | + "story_string_suffix": "", | |
| 21 | 24 | "name": "Vicuna 1.1" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": true, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "", | |
| 23 | + "story_string_suffix": "", | |
| 21 | 24 | "name": "WizardLM-13B" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "force", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "</s>", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "", | |
| 23 | + "story_string_suffix": "", | |
| 21 | 24 | "name": "WizardLM" |
| 22 | 25 | } |
| @@ -8,8 +8,6 @@ | ||
| 8 | 8 | "macro": true, |
| 9 | 9 | "names_behavior": "none", |
| 10 | 10 | "activation_regex": "", |
| 11 | - "system_sequence_prefix": "", | |
| 12 | - "system_sequence_suffix": "", | |
| 13 | 11 | "first_output_sequence": "", |
| 14 | 12 | "skip_examples": false, |
| 15 | 13 | "output_suffix": "", |
| @@ -18,5 +16,10 @@ | ||
| 18 | 16 | "user_alignment_message": "", |
| 19 | 17 | "system_same_as_user": false, |
| 20 | 18 | "last_system_sequence": "", |
| 19 | + "first_input_sequence": "", | |
| 20 | + "last_input_sequence": "", | |
| 21 | + "sequences_as_stop_strings": true, | |
| 22 | + "story_string_prefix": "## {{char}}\n- You're \"{{char}}\" in this never-ending roleplay with \"{{user}}\".\n### Input:", | |
| 23 | + "story_string_suffix": "### Response:\n(OOC) Understood. I will take this info into account for the roleplay. (end OOC)\n", | |
| 21 | 24 | "name": "simple-proxy-for-tavern" |
| 22 | 25 | } |
| @@ -160,8 +160,6 @@ | ||
| 160 | 160 | "macro": true, |
| 161 | 161 | "names_behavior": "force", |
| 162 | 162 | "activation_regex": "", |
| 163 | - "system_sequence_prefix": "", | |
| 164 | - "system_sequence_suffix": "", | |
| 165 | 163 | "first_output_sequence": "", |
| 166 | 164 | "skip_examples": false, |
| 167 | 165 | "output_suffix": "\n\n", |
| @@ -6,6 +6,8 @@ import { QuickReplyApi } from './scripts/extensions/quick-reply/api/QuickReplyAp | ||
| 6 | 6 | declare global { |
| 7 | 7 | // Custom types |
| 8 | 8 | declare type InstructSettings = typeof power_user.instruct; |
| 9 | + declare type ContextSettings = typeof power_user.context; | |
| 10 | + declare type ReasoningSettings = typeof power_user.reasoning; | |
| 9 | 11 | |
| 10 | 12 | // Global namespace modules |
| 11 | 13 | interface Window { |
| @@ -3774,6 +3774,35 @@ | ||
| 3774 | 3774 | <i class="editor_maximize fa-solid fa-maximize right_menu_button" data-for="context_story_string" title="Expand the editor" data-i18n="[title]Expand the editor"></i> |
| 3775 | 3775 | </label> |
| 3776 | 3776 | <textarea id="context_story_string" class="text_pole textarea_compact autoSetHeight"></textarea> |
| 3777 | + <div class="flex-container flexFlowColumn"> | |
| 3778 | + <div id="context_story_string_position_block"> | |
| 3779 | + <label for="context_story_string_position"> | |
| 3780 | + <small data-i18n="Position:">Position:</small> | |
| 3781 | + </label> | |
| 3782 | + <select id="context_story_string_position" class="text_pole"> | |
| 3783 | + <option value="0" data-i18n="Default (top of context)">Default (top of context)</option> | |
| 3784 | + <option value="1" data-i18n="In-chat @ Depth">In-chat @ Depth</option> | |
| 3785 | + </select> | |
| 3786 | + </div> | |
| 3787 | + <div id="context_story_string_inject_settings" class="flex-container"> | |
| 3788 | + <div class="flex1"> | |
| 3789 | + <label for="context_story_string_depth"> | |
| 3790 | + <small data-i18n="Depth:">Depth:</small> | |
| 3791 | + </label> | |
| 3792 | + <input type="number" id="context_story_string_depth" class="text_pole" min="0" max=""> | |
| 3793 | + </div> | |
| 3794 | + <div class="flex1"> | |
| 3795 | + <label for="context_story_string_role"> | |
| 3796 | + <small data-i18n="Role:">Role:</small> | |
| 3797 | + </label> | |
| 3798 | + <select id="context_story_string_role" class="text_pole"> | |
| 3799 | + <option data-i18n="System" value="0">System</option> | |
| 3800 | + <option data-i18n="User" value="1">User</option> | |
| 3801 | + <option data-i18n="Assistant" value="2">Assistant</option> | |
| 3802 | + </select> | |
| 3803 | + </div> | |
| 3804 | + </div> | |
| 3805 | + </div> | |
| 3777 | 3806 | <div class="flex-container"> |
| 3778 | 3807 | <div class="flex1"> |
| 3779 | 3808 | <label for="context_example_separator"> |
| @@ -3922,7 +3951,31 @@ | ||
| 3922 | 3951 | </span> |
| 3923 | 3952 | </b> |
| 3924 | 3953 | </h4> |
| 3925 | 3954 | <!-- We keep onesome auto-open so the user would know what is going on in the picked template --> |
| 3955 | + <details open> | |
| 3956 | + <summary> | |
| 3957 | + <span data-i18n="Story String Sequences">Story String Sequences</span> | |
| 3958 | + <small class="fa-solid fa-question-circle" title="Used in Default position only." data-i18n="[title]Used in Default position only."></small> | |
| 3959 | + </summary> | |
| 3960 | + <div class="flex-container"> | |
| 3961 | + <div class="flexAuto" title="Inserted before a Story String." data-i18n="[title]Inserted before a Story String."> | |
| 3962 | + <label for="instruct_story_string_prefix"> | |
| 3963 | + <small data-i18n="Story String Prefix">Story String Prefix</small> | |
| 3964 | + </label> | |
| 3965 | + <div> | |
| 3966 | + <textarea id="instruct_story_string_prefix" class="text_pole textarea_compact autoSetHeight"></textarea> | |
| 3967 | + </div> | |
| 3968 | + </div> | |
| 3969 | + <div class="flexAuto" title="Inserted after a Story String." data-i18n="[title]Inserted after a Story String."> | |
| 3970 | + <label for="instruct_story_string_suffix"> | |
| 3971 | + <small data-i18n="Story String Suffix">Story String Suffix</small> | |
| 3972 | + </label> | |
| 3973 | + <div> | |
| 3974 | + <textarea id="instruct_story_string_suffix" class="text_pole wide100p textarea_compact autoSetHeight"></textarea> | |
| 3975 | + </div> | |
| 3976 | + </div> | |
| 3977 | + </div> | |
| 3978 | + </details> | |
| 3926 | 3979 | <details open> |
| 3927 | 3980 | <summary data-i18n="User Message Sequences">User Message Sequences</summary> |
| 3928 | 3981 | <div class="flex-container"> |
| @@ -3969,27 +4022,6 @@ | ||
| 3969 | 4022 | </div> |
| 3970 | 4023 | </details> |
| 3971 | 4024 | <details> |
| 3972 | - <summary data-i18n="System Prompt Sequences">System Prompt Sequences</summary> | |
| 3973 | - <div class="flex-container"> | |
| 3974 | - <div class="flexAuto" title="Inserted before a System prompt." data-i18n="[title]Inserted before a System prompt."> | |
| 3975 | - <label for="instruct_system_sequence_prefix"> | |
| 3976 | - <small data-i18n="System Prompt Prefix">System Prompt Prefix</small> | |
| 3977 | - </label> | |
| 3978 | - <div> | |
| 3979 | - <textarea id="instruct_system_sequence_prefix" class="text_pole textarea_compact autoSetHeight"></textarea> | |
| 3980 | - </div> | |
| 3981 | - </div> | |
| 3982 | - <div class="flexAuto" title="Inserted after a System prompt." data-i18n="[title]Inserted after a System prompt."> | |
| 3983 | - <label for="instruct_system_sequence_suffix"> | |
| 3984 | - <small data-i18n="System Prompt Suffix">System Prompt Suffix</small> | |
| 3985 | - </label> | |
| 3986 | - <div> | |
| 3987 | - <textarea id="instruct_system_sequence_suffix" class="text_pole wide100p textarea_compact autoSetHeight"></textarea> | |
| 3988 | - </div> | |
| 3989 | - </div> | |
| 3990 | - </div> | |
| 3991 | - </details> | |
| 3992 | - <details> | |
| 3993 | 4025 | <summary data-i18n="Misc. Sequences">Misc. Sequences</summary> |
| 3994 | 4026 | <div class="flex-container"> |
| 3995 | 4027 | <div class="flexAuto" title="Inserted before the first Assistant's message." data-i18n="[title]Inserted before the first Assistant's message."> |
| @@ -176,7 +176,7 @@ import { | ||
| 176 | 176 | renderPaginationDropdown, |
| 177 | 177 | paginationDropdownChangeHandler, |
| 178 | 178 | } from './scripts/utils.js'; |
| 179 | 179 | import { debounce_timeout, GENERATION_TYPE_TRIGGERS, IGNORE_SYMBOL, inject_ids } from './scripts/constants.js'; |
| 180 | 180 | |
| 181 | 181 | import { cancelDebouncedMetadataSave, doDailyExtensionUpdatesCheck, extension_settings, initExtensions, loadExtensionSettings, runGenerationInterceptors, saveMetadataDebounced } from './scripts/extensions.js'; |
| 182 | 182 | import { COMMENT_NAME_DEFAULT, CONNECT_API_MAP, executeSlashCommandsOnChatInput, initDefaultSlashCommands, isExecutingCommandsFromChatInput, pauseScriptExecution, stopScriptExecution, UNIQUE_APIS } from './scripts/slash-commands.js'; |
| @@ -217,8 +217,8 @@ import { | ||
| 217 | 217 | formatInstructModeChat, |
| 218 | 218 | formatInstructModePrompt, |
| 219 | 219 | formatInstructModeExamples, |
| 220 | + formatInstructModeStoryString, | |
| 220 | 221 | getInstructStoppingSequences, |
| 221 | - formatInstructModeSystemPrompt, | |
| 222 | 222 | } from './scripts/instruct-mode.js'; |
| 223 | 223 | import { initLocales, t } from './scripts/i18n.js'; |
| 224 | 224 | import { getFriendlyTokenizerName, getTokenCount, getTokenCountAsync, initTokenizers, saveTokenCache } from './scripts/tokenizers.js'; |
| @@ -3108,7 +3108,7 @@ export function createRawPrompt(prompt, api, instructOverride, quietToLoud, syst | ||
| 3108 | 3108 | // prepend system prompt, if provided |
| 3109 | 3109 | if (systemPrompt) { |
| 3110 | 3110 | systemPrompt = substituteParams(systemPrompt); |
| 3111 | 3111 | systemPrompt = isInstruct ? (formatInstructModeSystemPromptformatInstructModeStoryString(systemPrompt) + '\n') : systemPrompt.trim(); |
| 3112 | 3112 | prompt.unshift({ role: 'system', content: systemPrompt }); |
| 3113 | 3113 | } |
| 3114 | 3114 | |
| @@ -3577,7 +3577,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 3577 | 3577 | system = power_user.prefer_character_prompt && system |
| 3578 | 3578 | ? substituteParams(system, name1, name2, (power_user.sysprompt.content ?? '')) |
| 3579 | 3579 | : baseChatReplace(power_user.sysprompt.content, name1, name2); |
| 3580 | 3580 | system = isInstruct ? formatInstructModeSystemPrompt(substituteParams(system, name1, name2, power_user.sysprompt.content)) : system; |
| 3581 | 3581 | } else { |
| 3582 | 3582 | // Nullify if it's not enabled |
| 3583 | 3583 | system = ''; |
| @@ -3591,13 +3591,13 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 3591 | 3591 | if (selected_group && Array.isArray(groupDepthPrompts) && groupDepthPrompts.length > 0) { |
| 3592 | 3592 | groupDepthPrompts.forEach((value, index) => { |
| 3593 | 3593 | const role = getExtensionPromptRoleByName(value.role); |
| 3594 | 3594 | setExtensionPrompt('DEPTH_PROMPT_' + inject_ids.DEPTH_PROMPT_INDEX(index), value.text, extension_prompt_types.IN_CHAT, value.depth, extension_settings.note.allowWIScan, role); |
| 3595 | 3595 | }); |
| 3596 | 3596 | } else { |
| 3597 | 3597 | const depthPromptText = charDepthPrompt || ''; |
| 3598 | 3598 | const depthPromptDepth = characters[this_chid]?.data?.extensions?.depth_prompt?.depth ?? depth_prompt_depth_default; |
| 3599 | 3599 | const depthPromptRole = getExtensionPromptRoleByName(characters[this_chid]?.data?.extensions?.depth_prompt?.role ?? depth_prompt_role_default); |
| 3600 | 3600 | setExtensionPrompt('inject_ids.DEPTH_PROMPT', depthPromptText, extension_prompt_types.IN_CHAT, depthPromptDepth, extension_settings.note.allowWIScan, depthPromptRole); |
| 3601 | 3601 | } |
| 3602 | 3602 | |
| 3603 | 3603 | // First message in fresh 1-on-1 chat reacts to user/character settings changes |
| @@ -3723,7 +3723,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 3723 | 3723 | |
| 3724 | 3724 | // Add WI to prompt (and also inject WI to AN value via hijack) |
| 3725 | 3725 | // Make quiet prompt available for WIAN |
| 3726 | 3726 | setExtensionPrompt('inject_ids.QUIET_PROMPT', quiet_prompt || '', extension_prompt_types.IN_PROMPT, 0, true); |
| 3727 | 3727 | const chatForWI = coreChat.map(x => world_info_include_names ? `${x.name}: ${x.mes}` : x.mes).reverse(); |
| 3728 | 3728 | /** @type {import('./scripts/world-info.js').WIGlobalScanData} */ |
| 3729 | 3729 | const globalScanData = { |
| @@ -3736,7 +3736,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 3736 | 3736 | trigger: GENERATION_TYPE_TRIGGERS.includes(type) ? type : 'normal', |
| 3737 | 3737 | }; |
| 3738 | 3738 | const { worldInfoString, worldInfoBefore, worldInfoAfter, worldInfoExamples, worldInfoDepth } = await getWorldInfoPrompt(chatForWI, this_max_context, dryRun, globalScanData); |
| 3739 | 3739 | setExtensionPrompt('inject_ids.QUIET_PROMPT', '', extension_prompt_types.IN_PROMPT, 0, true); |
| 3740 | 3740 | |
| 3741 | 3741 | // Add message example WI |
| 3742 | 3742 | for (const example of worldInfoExamples) { |
| @@ -3771,13 +3771,56 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 3771 | 3771 | if (Array.isArray(worldInfoDepth)) { |
| 3772 | 3772 | worldInfoDepth.forEach((e) => { |
| 3773 | 3773 | const joinedEntries = e.entries.join('\n'); |
| 3774 | 3774 | setExtensionPrompt(`customDepthWI-${inject_ids.CUSTOM_WI_DEPTH_ROLE(e.depth}-${, e.role}`), joinedEntries, extension_prompt_types.IN_CHAT, e.depth, false, e.role); |
| 3775 | 3775 | }); |
| 3776 | 3776 | } |
| 3777 | 3777 | } else { |
| 3778 | 3778 | console.log('skipping WIAN'); |
| 3779 | 3779 | } |
| 3780 | 3780 | |
| 3781 | + // Collect before / after story string injections | |
| 3782 | + const beforeScenarioAnchor = await getExtensionPrompt(extension_prompt_types.BEFORE_PROMPT); | |
| 3783 | + const afterScenarioAnchor = await getExtensionPrompt(extension_prompt_types.IN_PROMPT); | |
| 3784 | + | |
| 3785 | + const storyStringParams = { | |
| 3786 | + description: description, | |
| 3787 | + personality: personality, | |
| 3788 | + persona: power_user.persona_description_position == persona_description_positions.IN_PROMPT ? persona : '', | |
| 3789 | + scenario: scenario, | |
| 3790 | + system: system, | |
| 3791 | + char: name2, | |
| 3792 | + user: name1, | |
| 3793 | + wiBefore: worldInfoBefore, | |
| 3794 | + wiAfter: worldInfoAfter, | |
| 3795 | + loreBefore: worldInfoBefore, | |
| 3796 | + loreAfter: worldInfoAfter, | |
| 3797 | + anchorBefore: beforeScenarioAnchor.trim(), | |
| 3798 | + anchorAfter: afterScenarioAnchor.trim(), | |
| 3799 | + mesExamples: mesExamplesArray.join(''), | |
| 3800 | + mesExamplesRaw: mesExamplesRawArray.join(''), | |
| 3801 | + }; | |
| 3802 | + | |
| 3803 | + // Render the story string and combine with injections | |
| 3804 | + const storyString = renderStoryString(storyStringParams); | |
| 3805 | + let combinedStoryString = isInstruct ? formatInstructModeStoryString(storyString) : storyString; | |
| 3806 | + | |
| 3807 | + // Inject the story string as in-chat prompt (if needed) | |
| 3808 | + const applyStoryStringInject = main_api !== 'openai' && power_user.context.story_string_position === extension_prompt_types.IN_CHAT; | |
| 3809 | + if (applyStoryStringInject) { | |
| 3810 | + const depth = power_user.context.story_string_depth ?? 1; | |
| 3811 | + const role = power_user.context.story_string_role ?? extension_prompt_roles.SYSTEM; | |
| 3812 | + setExtensionPrompt(inject_ids.STORY_STRING, combinedStoryString, extension_prompt_types.IN_CHAT, depth, false, role); | |
| 3813 | + // Remove to prevent duplication | |
| 3814 | + combinedStoryString = ''; | |
| 3815 | + } else { | |
| 3816 | + setExtensionPrompt(inject_ids.STORY_STRING, '', extension_prompt_types.IN_CHAT, 0); | |
| 3817 | + } | |
| 3818 | + | |
| 3819 | + // Story string rendered, safe to remove | |
| 3820 | + if (power_user.strip_examples) { | |
| 3821 | + mesExamplesArray = []; | |
| 3822 | + } | |
| 3823 | + | |
| 3781 | 3824 | // Inject all Depth prompts. Chat Completion does it separately |
| 3782 | 3825 | let injectedIndices = []; |
| 3783 | 3826 | if (main_api !== 'openai') { |
| @@ -3867,33 +3910,6 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 3867 | 3910 | userAlignmentMessage = formatMessageHistoryItem(alignmentMessage, isInstruct, force_output_sequence.FIRST); |
| 3868 | 3911 | } |
| 3869 | 3912 | |
| 3870 | - // Call combined AN into Generate | |
| 3871 | - const beforeScenarioAnchor = (await getExtensionPrompt(extension_prompt_types.BEFORE_PROMPT)).trimStart(); | |
| 3872 | - const afterScenarioAnchor = await getExtensionPrompt(extension_prompt_types.IN_PROMPT); | |
| 3873 | - | |
| 3874 | - const storyStringParams = { | |
| 3875 | - description: description, | |
| 3876 | - personality: personality, | |
| 3877 | - persona: power_user.persona_description_position == persona_description_positions.IN_PROMPT ? persona : '', | |
| 3878 | - scenario: scenario, | |
| 3879 | - system: system, | |
| 3880 | - char: name2, | |
| 3881 | - user: name1, | |
| 3882 | - wiBefore: worldInfoBefore, | |
| 3883 | - wiAfter: worldInfoAfter, | |
| 3884 | - loreBefore: worldInfoBefore, | |
| 3885 | - loreAfter: worldInfoAfter, | |
| 3886 | - mesExamples: mesExamplesArray.join(''), | |
| 3887 | - mesExamplesRaw: mesExamplesRawArray.join(''), | |
| 3888 | - }; | |
| 3889 | - | |
| 3890 | - const storyString = renderStoryString(storyStringParams); | |
| 3891 | - | |
| 3892 | - // Story string rendered, safe to remove | |
| 3893 | - if (power_user.strip_examples) { | |
| 3894 | - mesExamplesArray = []; | |
| 3895 | - } | |
| 3896 | - | |
| 3897 | 3913 | let oaiMessages = []; |
| 3898 | 3914 | let oaiMessageExamples = []; |
| 3899 | 3915 | |
| @@ -3913,9 +3929,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 3913 | 3929 | |
| 3914 | 3930 | async function getMessagesTokenCount() { |
| 3915 | 3931 | const encodeString = [ |
| 3916 | 3932 | beforeScenarioAnchorcombinedStoryString, |
| 3917 | - storyString, | |
| 3918 | - afterScenarioAnchor, | |
| 3919 | 3933 | examplesString, |
| 3920 | 3934 | userAlignmentMessage, |
| 3921 | 3935 | chatString, |
| @@ -4177,9 +4191,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 4177 | 4191 | setPromptString(); |
| 4178 | 4192 | const jointMessages = mesSend.map((e) => `${e.extensionPrompts.join('')}${e.message}`).join(''); |
| 4179 | 4193 | const prompt = [ |
| 4180 | 4194 | beforeScenarioAnchorcombinedStoryString, |
| 4181 | - storyString, | |
| 4182 | - afterScenarioAnchor, | |
| 4183 | 4195 | mesExmString, |
| 4184 | 4196 | addChatsPreamble(addChatsSeparator(jointMessages)), |
| 4185 | 4197 | '\n', |
| @@ -4278,14 +4290,12 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 4278 | 4290 | // add chat preamble |
| 4279 | 4291 | mesSendString = addChatsPreamble(mesSendString); |
| 4280 | 4292 | |
| 4281 | 4293 | let combinedPrompt = beforeScenarioAnchor +[ |
| 4282 | - storyString + | |
| 4294 | + combinedStoryString, | |
| 4283 | - afterScenarioAnchor + | |
| 4295 | + mesExmString, | |
| 4284 | - mesExmString + | |
| 4296 | + mesSendString, | |
| 4285 | - mesSendString + | |
| 4297 | + generatedPromptCache, | |
| 4286 | - generatedPromptCache; | |
| 4298 | + ].join('').replace(/\r/gm, ''); | |
| 4287 | - | |
| 4288 | - combinedPrompt = combinedPrompt.replace(/\r/gm, ''); | |
| 4289 | 4299 | |
| 4290 | 4300 | if (power_user.collapse_newlines) { |
| 4291 | 4301 | combinedPrompt = collapseNewlines(combinedPrompt); |
| @@ -4774,7 +4784,7 @@ async function doChatInject(messages, isContinue) { | ||
| 4774 | 4784 | function flushWIDepthInjections() { |
| 4775 | 4785 | //prevent custom depth WI entries (which have unique random key names) from duplicating |
| 4776 | 4786 | for (const key of Object.keys(extension_prompts)) { |
| 4777 | 4787 | if (key.startsWith('customDepthWI'inject_ids.CUSTOM_WI_DEPTH)) { |
| 4778 | 4788 | delete extension_prompts[key]; |
| 4779 | 4789 | } |
| 4780 | 4790 | } |
| @@ -5328,11 +5338,7 @@ export function extractMessageFromData(data, activeApi = null) { | ||
| 5328 | 5338 | case 'koboldhorde': |
| 5329 | 5339 | return data.text; |
| 5330 | 5340 | case 'textgenerationwebui': |
| 5331 | - return data.choices?.[0]?.text | |
| 5341 | + return data.choices?.[0]?.text ?? data.choices?.[0]?.message?.content ?? data.content ?? data.response ?? ''; | |
| 5332 | - ?? data.choices?.[0]?.message?.content | |
| 5333 | - ?? data.content | |
| 5334 | - ?? data.response | |
| 5335 | - ?? ''; | |
| 5336 | 5342 | case 'novel': |
| 5337 | 5343 | return data.output; |
| 5338 | 5344 | case 'openai': |
| @@ -7707,7 +7713,7 @@ export function getExtensionPromptRoleByName(roleName) { | ||
| 7707 | 7713 | */ |
| 7708 | 7714 | export function removeDepthPrompts() { |
| 7709 | 7715 | for (const key of Object.keys(extension_prompts)) { |
| 7710 | 7716 | if (key.startsWith('inject_ids.DEPTH_PROMPT')) { |
| 7711 | 7717 | delete extension_prompts[key]; |
| 7712 | 7718 | } |
| 7713 | 7719 | } |
| @@ -40,3 +40,15 @@ export const GENERATION_TYPE_TRIGGERS = [ | ||
| 40 | 40 | 'regenerate', |
| 41 | 41 | 'quiet', |
| 42 | 42 | ]; |
| 43 | + | |
| 44 | +/** | |
| 45 | + * Known injection IDs and helper functions for system extensions handling. | |
| 46 | + */ | |
| 47 | +export const inject_ids = { | |
| 48 | + STORY_STRING: '__STORY_STRING__', | |
| 49 | + QUIET_PROMPT: 'QUIET_PROMPT', | |
| 50 | + DEPTH_PROMPT: 'DEPTH_PROMPT', | |
| 51 | + DEPTH_PROMPT_INDEX: (index) => `DEPTH_PROMPT_${index}`, | |
| 52 | + CUSTOM_WI_DEPTH: 'customDepthWI', | |
| 53 | + CUSTOM_WI_DEPTH_ROLE: (depth, role) => `customDepthWI_${depth}_${role}`, | |
| 54 | +}; | |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | 'use strict'; |
| 2 | 2 | |
| 3 | 3 | import { extension_prompt_types, name1, name2, online_status, saveSettingsDebounced, substituteParams } from '../script.js'; |
| 4 | 4 | import { selected_group } from './group-chats.js'; |
| 5 | 5 | import { parseExampleIntoIndividual } from './openai.js'; |
| 6 | 6 | import { |
| @@ -24,8 +24,8 @@ const controls = [ | ||
| 24 | 24 | { id: 'instruct_enabled', property: 'enabled', isCheckbox: true }, |
| 25 | 25 | { id: 'instruct_wrap', property: 'wrap', isCheckbox: true }, |
| 26 | 26 | { id: 'instruct_macro', property: 'macro', isCheckbox: true }, |
| 27 | 27 | { id: 'instruct_system_sequence_prefixinstruct_story_string_prefix', property: 'system_sequence_prefixstory_string_prefix', isCheckbox: false }, |
| 28 | 28 | { id: 'instruct_system_sequence_suffixinstruct_story_string_suffix', property: 'system_sequence_suffixstory_string_suffix', isCheckbox: false }, |
| 29 | 29 | { id: 'instruct_input_sequence', property: 'input_sequence', isCheckbox: false }, |
| 30 | 30 | { id: 'instruct_input_suffix', property: 'input_suffix', isCheckbox: false }, |
| 31 | 31 | { id: 'instruct_output_sequence', property: 'output_sequence', isCheckbox: false }, |
| @@ -76,11 +76,12 @@ function migrateInstructModeSettings(settings) { | ||
| 76 | 76 | last_system_sequence: '', |
| 77 | 77 | first_input_sequence: '', |
| 78 | 78 | last_input_sequence: '', |
| 79 | - names_force_groups: true, | |
| 80 | 79 | skip_examples: false, |
| 81 | 80 | system_same_as_user: false, |
| 82 | 81 | names_behavior: names_behavior_types.FORCE, |
| 83 | 82 | sequences_as_stop_strings: true, |
| 83 | + story_string_prefix: '', | |
| 84 | + story_string_suffix: '', | |
| 84 | 85 | }; |
| 85 | 86 | |
| 86 | 87 | for (let key in defaults) { |
| @@ -88,6 +89,19 @@ function migrateInstructModeSettings(settings) { | ||
| 88 | 89 | settings[key] = defaults[key]; |
| 89 | 90 | } |
| 90 | 91 | } |
| 92 | + | |
| 93 | + const obsoleteFields = [ | |
| 94 | + 'names', | |
| 95 | + 'names_force_groups', | |
| 96 | + 'system_sequence_prefix', | |
| 97 | + 'system_sequence_suffix', | |
| 98 | + ]; | |
| 99 | + | |
| 100 | + for (const field of obsoleteFields) { | |
| 101 | + if (Object.hasOwn(settings, field)) { | |
| 102 | + delete settings[field]; | |
| 103 | + } | |
| 104 | + } | |
| 91 | 105 | } |
| 92 | 106 | |
| 93 | 107 | /** |
| @@ -445,29 +459,46 @@ export function formatInstructModeChat(name, mes, isUser, isNarrator, forceAvata | ||
| 445 | 459 | /** |
| 446 | 460 | * Formats instruct mode system prompt. |
| 447 | 461 | * @param {string} systemPrompt System prompt string. |
| 448 | 462 | * @param {InstructSettings} customInstruct_customInstruct Custom instruct mode settings. |
| 449 | 463 | * @returns {string} Formatted instruct mode system prompt. |
| 464 | + * @deprecated Currently doesn't do anything useful. | |
| 450 | 465 | */ |
| 451 | 466 | export function formatInstructModeSystemPrompt(systemPrompt, customInstruct_customInstruct = null) { |
| 452 | - if (!systemPrompt) { | |
| 467 | + return systemPrompt || ''; | |
| 453 | - return ''; | |
| 454 | 468 | } |
| 455 | 469 | |
| 456 | - const instruct = structuredClone(customInstruct ?? power_user.instruct); | |
| 470 | +/** | |
| 471 | + * Formats instruct mode story string. | |
| 472 | + * @param {string} storyString Story string and anchors | |
| 473 | + * @param {object} [params] | |
| 474 | + * @param {ContextSettings} [params.customContext] Custom context settings. | |
| 475 | + * @param {InstructSettings} [params.customInstruct] Custom instruct mode settings. | |
| 476 | + * @returns {string} Formatted instruct mode story string. | |
| 477 | + */ | |
| 478 | +export function formatInstructModeStoryString(storyString, { customContext = null, customInstruct = null } = {}) { | |
| 479 | + if (!storyString) { | |
| 480 | + return ''; | |
| 481 | + } | |
| 457 | 482 | |
| 458 | - const separator = instruct.wrap ? '\n' : ''; | |
| 483 | + const instructSettings = structuredClone(customInstruct ?? power_user.instruct); | |
| 484 | + const contextSettings = structuredClone(customContext ?? power_user.context); | |
| 485 | + const storyStringPosition = contextSettings.story_string_position ?? extension_prompt_types.IN_PROMPT; | |
| 459 | 486 | |
| 460 | - if (instruct.system_sequence_prefix) { | |
| 487 | + // Only wrap if not in-chat position (it will be wrapped by message sequences instead) | |
| 488 | + const applySequences = storyStringPosition !== extension_prompt_types.IN_CHAT; | |
| 489 | + const separator = instructSettings.wrap ? '\n' : ''; | |
| 490 | + if (applySequences && instructSettings.story_string_prefix) { | |
| 461 | 491 | // TODO: Replace with a proper 'System' prompt entity name input |
| 462 | 492 | const prefix = instructsubstituteParams(instructSettings.system_sequence_prefixstory_string_prefix).replace(/{{name}}/gi, 'System'); |
| 463 | 493 | systemPromptstoryString = prefix + separator + systemPromptstoryString; |
| 464 | 494 | } |
| 465 | 495 | |
| 466 | 496 | if (instructapplySequences && instructSettings.system_sequence_suffixstory_string_suffix) { |
| 467 | - systemPrompt = systemPrompt + separator + instruct.system_sequence_suffix; | |
| 497 | + const suffix = substituteParams(instructSettings.story_string_suffix); | |
| 498 | + storyString = storyString + suffix; | |
| 468 | 499 | } |
| 469 | 500 | |
| 470 | 501 | return systemPromptstoryString; |
| 471 | 502 | } |
| 472 | 503 | |
| 473 | 504 | /** |
| @@ -644,13 +675,13 @@ export function getInstructMacros(env) { | ||
| 644 | 675 | const instructMacros = [ |
| 645 | 676 | // Instruct template macros |
| 646 | 677 | { |
| 647 | 678 | key: 'instructSystemPromptPrefixinstructStoryStringPrefix', |
| 648 | 679 | value: power_user.instruct.system_sequence_prefixstory_string_prefix, |
| 649 | 680 | enabled: power_user.instruct.enabled, |
| 650 | 681 | }, |
| 651 | 682 | { |
| 652 | 683 | key: 'instructSystemPromptSuffixinstructStoryStringSuffix', |
| 653 | 684 | value: power_user.instruct.system_sequence_suffixstory_string_suffix, |
| 654 | 685 | enabled: power_user.instruct.enabled, |
| 655 | 686 | }, |
| 656 | 687 | { |
| @@ -27,6 +27,8 @@ import { | ||
| 27 | 27 | doNewChat, |
| 28 | 28 | online_status, |
| 29 | 29 | messageFormatting, |
| 30 | + extension_prompt_types, | |
| 31 | + extension_prompt_roles, | |
| 30 | 32 | } from '../script.js'; |
| 31 | 33 | import { isMobile, initMovingUI, favsToHotswap } from './RossAscends-mods.js'; |
| 32 | 34 | import { |
| @@ -227,8 +229,8 @@ export const power_user = { | ||
| 227 | 229 | first_output_sequence: '', |
| 228 | 230 | last_input_sequence: '', |
| 229 | 231 | last_output_sequence: '', |
| 230 | 232 | system_sequence_prefixstory_string_prefix: '', |
| 231 | 233 | system_sequence_suffixstory_string_suffix: '', |
| 232 | 234 | stop_sequence: '', |
| 233 | 235 | wrap: true, |
| 234 | 236 | macro: true, |
| @@ -249,6 +251,9 @@ export const power_user = { | ||
| 249 | 251 | example_separator: defaultExampleSeparator, |
| 250 | 252 | use_stop_strings: true, |
| 251 | 253 | names_as_stop_strings: true, |
| 254 | + story_string_position: extension_prompt_types.IN_PROMPT, | |
| 255 | + story_string_role: extension_prompt_roles.SYSTEM, | |
| 256 | + story_string_depth: 1, | |
| 252 | 257 | }, |
| 253 | 258 | |
| 254 | 259 | instruct_derived: false, |
| @@ -347,6 +352,9 @@ const contextControls = [ | ||
| 347 | 352 | { id: 'context_chat_start', property: 'chat_start', isCheckbox: false, isGlobalSetting: false }, |
| 348 | 353 | { id: 'context_use_stop_strings', property: 'use_stop_strings', isCheckbox: true, isGlobalSetting: false, defaultValue: false }, |
| 349 | 354 | { id: 'context_names_as_stop_strings', property: 'names_as_stop_strings', isCheckbox: true, isGlobalSetting: false, defaultValue: true }, |
| 355 | + { id: 'context_story_string_position', property: 'story_string_position', isCheckbox: false, isGlobalSetting: false, defaultValue: extension_prompt_types.IN_PROMPT, trigger: true }, | |
| 356 | + { id: 'context_story_string_depth', property: 'story_string_depth', isCheckbox: false, isGlobalSetting: false, defaultValue: 1 }, | |
| 357 | + { id: 'context_story_string_role', property: 'story_string_role', isCheckbox: false, isGlobalSetting: false, defaultValue: extension_prompt_roles.SYSTEM }, | |
| 350 | 358 | |
| 351 | 359 | // Existing power user settings |
| 352 | 360 | { id: 'always-force-name2-checkbox', property: 'always_force_name2', isCheckbox: true, isGlobalSetting: true, defaultValue: true }, |
| @@ -1860,6 +1868,47 @@ export function getContextSettings() { | ||
| 1860 | 1868 | // TODO: Maybe add a refresh button to reset settings to preset |
| 1861 | 1869 | // TODO: Add "global state" if a preset doesn't set the power_user checkboxes |
| 1862 | 1870 | async function loadContextSettings() { |
| 1871 | + /** | |
| 1872 | + * Auto-fix missing fields in the story string | |
| 1873 | + * @param {ContextSettings} contextSettings Context settings instance | |
| 1874 | + */ | |
| 1875 | + function autoFixStoryString(contextSettings) { | |
| 1876 | + // Already migrated, no need to fix | |
| 1877 | + if (!contextSettings || Object.hasOwn(contextSettings, 'story_string_position')) { | |
| 1878 | + return; | |
| 1879 | + } | |
| 1880 | + | |
| 1881 | + let storyString = contextSettings.story_string || ''; | |
| 1882 | + | |
| 1883 | + /** | |
| 1884 | + * @param {string} field Missing field name | |
| 1885 | + * @param {'start'|'end'} position Position of auto-fix | |
| 1886 | + */ | |
| 1887 | + function autoFixMissingField(field, position) { | |
| 1888 | + if (storyString.includes(`{{${field}}}`)) { | |
| 1889 | + return; | |
| 1890 | + } | |
| 1891 | + | |
| 1892 | + console.warn(`[Story String Validation] Story String is missing a field: ${field}. Adding it at the ${position}.`); | |
| 1893 | + const fieldTemplate = `{{#if ${field}}}{{${field}}}\n{{/if}}`; | |
| 1894 | + const firstCurlyPosition = storyString.includes('{{') ? storyString.indexOf('{{') : 0; | |
| 1895 | + const lastCurlyPosition = storyString.includes('}}') ? storyString.lastIndexOf('}}') + '}}'.length : storyString.length; | |
| 1896 | + const lastTrimPosition = storyString.includes('{{trim}}') ? storyString.lastIndexOf('{{trim}}') : storyString.length; | |
| 1897 | + const endPosition = Math.min(lastTrimPosition, lastCurlyPosition); | |
| 1898 | + storyString = position === 'start' | |
| 1899 | + ? storyString.substring(0, firstCurlyPosition) + fieldTemplate + storyString.substring(firstCurlyPosition) | |
| 1900 | + : storyString.substring(0, endPosition) + fieldTemplate + storyString.substring(endPosition); | |
| 1901 | + } | |
| 1902 | + | |
| 1903 | + autoFixMissingField('anchorBefore', 'start'); | |
| 1904 | + autoFixMissingField('anchorAfter', 'end'); | |
| 1905 | + | |
| 1906 | + contextSettings.story_string = storyString; | |
| 1907 | + } | |
| 1908 | + | |
| 1909 | + // Migrate story string to add missing fields | |
| 1910 | + autoFixStoryString(power_user.context); | |
| 1911 | + | |
| 1863 | 1912 | contextControls.forEach(control => { |
| 1864 | 1913 | const $element = $(`#${control.id}`); |
| 1865 | 1914 | |
| @@ -1881,7 +1930,10 @@ async function loadContextSettings() { | ||
| 1881 | 1930 | // If the setting already exists, no need to duplicate it |
| 1882 | 1931 | // TODO: Maybe check the power_user object for the setting instead of a flag? |
| 1883 | 1932 | $element.on('input', async function () { |
| 1884 | 1933 | constlet value = control.isCheckbox ? !!$(this).prop('checked') : $(this).val(); |
| 1934 | + if (typeof control.defaultValue === 'number') { | |
| 1935 | + value = Number(value); | |
| 1936 | + } | |
| 1885 | 1937 | if (control.isGlobalSetting) { |
| 1886 | 1938 | power_user[control.property] = value; |
| 1887 | 1939 | } else { |
| @@ -1893,6 +1945,10 @@ async function loadContextSettings() { | ||
| 1893 | 1945 | } |
| 1894 | 1946 | saveSettingsDebounced(); |
| 1895 | 1947 | }); |
| 1948 | + | |
| 1949 | + if (control.trigger) { | |
| 1950 | + $element.trigger('input'); | |
| 1951 | + } | |
| 1896 | 1952 | }); |
| 1897 | 1953 | |
| 1898 | 1954 | context_presets.forEach((preset) => { |
| @@ -1912,6 +1968,9 @@ async function loadContextSettings() { | ||
| 1912 | 1968 | return; |
| 1913 | 1969 | } |
| 1914 | 1970 | |
| 1971 | + // Migrate story string to add missing fields | |
| 1972 | + autoFixStoryString(preset); | |
| 1973 | + | |
| 1915 | 1974 | power_user.context.preset = name; |
| 1916 | 1975 | |
| 1917 | 1976 | contextControls.forEach(control => { |
| @@ -2095,12 +2154,15 @@ export function fuzzySearchGroups(searchValue, fuzzySearchCaches = null) { | ||
| 2095 | 2154 | * @param {object} [options] Additional options. |
| 2096 | 2155 | * @param {string} [options.customStoryString] Custom story string template. |
| 2097 | 2156 | * @param {InstructSettings} [options.customInstructSettings] Custom instruct settings. |
| 2157 | + * @param {ContextSettings} [options.customContextSettings] Custom context settings. | |
| 2098 | 2158 | * @returns {string} The rendered story string. |
| 2099 | 2159 | */ |
| 2100 | 2160 | export function renderStoryString(params, { customStoryString = null, customInstructSettings = null, customContextSettings = null } = {}) { |
| 2101 | 2161 | try { |
| 2102 | - const storyString = customStoryString ?? power_user.context.story_string; | |
| 2103 | 2162 | const instructSettings = structuredClone(customInstructSettings ?? power_user.instruct); |
| 2163 | + const contextSettings = structuredClone(customContextSettings ?? power_user.context); | |
| 2164 | + const storyString = customStoryString ?? contextSettings.story_string; | |
| 2165 | + const storyStringPosition = contextSettings.story_string_position ?? extension_prompt_types.IN_PROMPT; | |
| 2104 | 2166 | |
| 2105 | 2167 | // Validate and log possible warnings/errors |
| 2106 | 2168 | validateStoryString(storyString, params); |
| @@ -2118,8 +2180,8 @@ export function renderStoryString(params, { customStoryString = null, customInst | ||
| 2118 | 2180 | output = output.replace(/^\n+/, ''); |
| 2119 | 2181 | |
| 2120 | 2182 | // add a newline to the end of the story string if it doesn't have one |
| 2121 | 2183 | if (output.length > 0 && !output.endsWith('\n') && storyStringPosition !== extension_prompt_types.IN_CHAT) { |
| 2122 | 2184 | if (!instructSettings.enabled || (instructSettings.wrap && !instructSettings.story_string_suffix)) { |
| 2123 | 2185 | output += '\n'; |
| 2124 | 2186 | } |
| 2125 | 2187 | } |
| @@ -3272,6 +3334,11 @@ jQuery(() => { | ||
| 3272 | 3334 | $('#context_size_derived').prop('checked', !!power_user.context_size_derived); |
| 3273 | 3335 | }); |
| 3274 | 3336 | |
| 3337 | + $('#context_story_string_position').on('input', function () { | |
| 3338 | + const value = Number($(this).val()); | |
| 3339 | + $('#context_story_string_inject_settings').toggle(value === extension_prompt_types.IN_CHAT); | |
| 3340 | + }); | |
| 3341 | + | |
| 3275 | 3342 | $('#bind_model_templates').on('input', function () { |
| 3276 | 3343 | if (bindModelTemplates(power_user, online_status)) { |
| 3277 | 3344 | saveSettingsDebounced(); |
| @@ -64,8 +64,8 @@ | ||
| 64 | 64 | <li><tt>{{chatStart}}</tt> – <span data-i18n="help_macros_43">context template chat start line</span></li> |
| 65 | 65 | <li><tt>{{systemPrompt}}</tt> – <span data-i18n="help_macros_44">system prompt content if enabled (either character prompt override if allowed, or defaultSystemPrompt)</span></li> |
| 66 | 66 | <li><tt>{{defaultSystemPrompt}}</tt> – <span data-i18n="help_macros_45">system prompt content</span></li> |
| 67 | 67 | <li><tt>{{instructSystemPromptPrefixinstructStoryStringPrefix}}</tt> – <span data-i18n="help_macros_46">instruct systemstory promptstring prefix sequence</span></li> |
| 68 | 68 | <li><tt>{{instructSystemPromptSuffixinstructStoryStringSuffix}}</tt> – <span data-i18n="help_macros_47">instruct systemstory promptstring suffix sequence</span></li> |
| 69 | 69 | <li><tt>{{instructUserPrefix}}</tt> – <span data-i18n="help_macros_48">instruct user prefix sequence</span></li> |
| 70 | 70 | <li><tt>{{instructUserSuffix}}</tt> – <span data-i18n="help_macros_49">instruct user suffix sequence</span></li> |
| 71 | 71 | <li><tt>{{instructAssistantPrefix}}</tt> – <span data-i18n="help_macros_50">instruct assistant prefix sequence</span></li> |