Expose new post-processing as "Semi-strict"

This commit is contained in:
Cohee
2024-12-29 21:20:15 +02:00
parent c9db7a1574
commit cdb31699d4
3 changed files with 7 additions and 3 deletions

View File

@ -3329,8 +3329,9 @@
<h4 data-i18n="Prompt Post-Processing">Prompt Post-Processing</h4> <h4 data-i18n="Prompt Post-Processing">Prompt Post-Processing</h4>
<select id="custom_prompt_post_processing" class="text_pole" title="Applies additional processing to the prompt before sending it to the API." data-i18n="[title]Applies additional processing to the prompt before sending it to the API."> <select id="custom_prompt_post_processing" class="text_pole" title="Applies additional processing to the prompt before sending it to the API." data-i18n="[title]Applies additional processing to the prompt before sending it to the API.">
<option data-i18n="prompt_post_processing_none" value="">None</option> <option data-i18n="prompt_post_processing_none" value="">None</option>
<option value="merge">Merge consecutive roles</option> <option data-i18n="prompt_post_processing_merge" value="merge">Merge consecutive roles</option>
<option value="strict">Strict (user first, alternating roles)</option> <option data-i18n="prompt_post_processing_semi" value="semi">Semi-strict (alternating roles)</option>
<option data-i18n="prompt_post_processing_strict" value="strict">Strict (user first, alternating roles)</option>
</select> </select>
</form> </form>
<div id="01ai_form" data-source="01ai"> <div id="01ai_form" data-source="01ai">

View File

@ -205,6 +205,7 @@ const custom_prompt_post_processing_types = {
/** @deprecated Use MERGE instead. */ /** @deprecated Use MERGE instead. */
CLAUDE: 'claude', CLAUDE: 'claude',
MERGE: 'merge', MERGE: 'merge',
SEMI: 'semi',
STRICT: 'strict', STRICT: 'strict',
}; };

View File

@ -64,7 +64,9 @@ function postProcessPrompt(messages, type, names) {
switch (type) { switch (type) {
case 'merge': case 'merge':
case 'claude': case 'claude':
return mergeMessages(messages, names, false, true); return mergeMessages(messages, names, false, false);
case 'semi':
return mergeMessages(messages, names, true, false);
case 'strict': case 'strict':
return mergeMessages(messages, names, true, true); return mergeMessages(messages, names, true, true);
case 'deepseek': case 'deepseek':