mirror of
https://github.com/Wx-2025/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 17:25:51 +00:00
Update historiographer.js
This commit is contained in:
@@ -302,7 +302,8 @@ async function getSummary(formattedHistory, toastTitle) {
|
||||
toastr.info(`正在为您熔铸对话历史...`, toastTitle);
|
||||
const settings = extension_settings[extensionName];
|
||||
const presetPrompts = await getPresetPrompts('small_summary');
|
||||
|
||||
|
||||
// 获取混合排序
|
||||
let mixedOrder;
|
||||
try {
|
||||
const savedOrder = localStorage.getItem('amily2_prompt_presets_v2_mixed_order');
|
||||
@@ -317,16 +318,19 @@ async function getSummary(formattedHistory, toastTitle) {
|
||||
const messages = [
|
||||
{ role: 'system', content: generateRandomSeed() }
|
||||
];
|
||||
|
||||
let promptCounter = 0;
|
||||
|
||||
// 根据混合排序添加提示词
|
||||
let promptCounter = 0; // 用于跟踪已处理的提示词数量
|
||||
|
||||
for (const item of order) {
|
||||
if (item.type === 'prompt') {
|
||||
// 处理普通提示词 - getPresetPrompts已经按照mixedOrder排序,直接按顺序使用
|
||||
if (presetPrompts && presetPrompts[promptCounter]) {
|
||||
messages.push(presetPrompts[promptCounter]);
|
||||
promptCounter++;
|
||||
promptCounter++; // 递增计数器
|
||||
}
|
||||
} else if (item.type === 'conditional') {
|
||||
// 处理条件块
|
||||
switch (item.id) {
|
||||
case 'jailbreakPrompt':
|
||||
if (settings.historiographySmallJailbreakPrompt) {
|
||||
|
||||
Reference in New Issue
Block a user