Expose new post-processing as "Semi-strict"

cdb31699d4020d18d3273e48d749bfc52b0f1f23

Cohee <18619528+Cohee1207@users.noreply.github.com>

3 files changed, +7 -3Showing whitespace changes
public/index.html+3 -2
@@ -3329,8 +3329,9 @@
3329 <h4 data-i18n="Prompt Post-Processing">Prompt Post-Processing</h4>3329 <h4 data-i18n="Prompt Post-Processing">Prompt Post-Processing</h4>
3330 <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.">3330 <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.">
3331 <option data-i18n="prompt_post_processing_none" value="">None</option>3331 <option data-i18n="prompt_post_processing_none" value="">None</option>
3332 <option value="merge">Merge consecutive roles</option>3332 <option data-i18n="prompt_post_processing_merge" value="merge">Merge consecutive roles</option>
3333 <option value="strict">Strict (user first, alternating roles)</option>3333 <option data-i18n="prompt_post_processing_semi" value="semi">Semi-strict (alternating roles)</option>
3334 <option data-i18n="prompt_post_processing_strict" value="strict">Strict (user first, alternating roles)</option>
3334 </select>3335 </select>
3335 </form>3336 </form>
3336 <div id="01ai_form" data-source="01ai">3337 <div id="01ai_form" data-source="01ai">
public/scripts/openai.js+1 -0
@@ -205,6 +205,7 @@ const custom_prompt_post_processing_types = {
205 /** @deprecated Use MERGE instead. */205 /** @deprecated Use MERGE instead. */
206 CLAUDE: 'claude',206 CLAUDE: 'claude',
207 MERGE: 'merge',207 MERGE: 'merge',
208 SEMI: 'semi',
208 STRICT: 'strict',209 STRICT: 'strict',
209};210};
210211
src/endpoints/backends/chat-completions.js+3 -1
@@ -64,7 +64,9 @@ function postProcessPrompt(messages, type, names) {
64 switch (type) {64 switch (type) {
65 case 'merge':65 case 'merge':
66 case 'claude':66 case 'claude':
67 return mergeMessages(messages, names, false, true);67 return mergeMessages(messages, names, false, false);
68 case 'semi':
69 return mergeMessages(messages, names, true, false);
68 case 'strict':70 case 'strict':
69 return mergeMessages(messages, names, true, true);71 return mergeMessages(messages, names, true, true);
70 case 'deepseek':72 case 'deepseek':