Account for generated depth on non-continue
| @@ -3866,7 +3866,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 3866 | 3866 | coreChat = await Promise.all(coreChat.map(async (chatItem, index) => { |
| 3867 | 3867 | let message = chatItem.mes; |
| 3868 | 3868 | let regexType = chatItem.is_user ? regex_placement.USER_INPUT : regex_placement.AI_OUTPUT; |
| 3869 | 3869 | let options = { isPrompt: true, depth: (coreChat.length - index - (isContinue?1:0)) }; |
| 3870 | 3870 | |
| 3871 | 3871 | let regexedMessage = getRegexedString(message, regexType, options); |
| 3872 | 3872 | regexedMessage = await appendFileContent(chatItem, regexedMessage); |
| @@ -3884,7 +3884,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 3884 | 3884 | |
| 3885 | 3885 | const reasoning = new PromptReasoning(); |
| 3886 | 3886 | for (let i = coreChat.length - 1; i >= 0; i--) { |
| 3887 | 3887 | const depth = coreChat.length - i - (isContinue?1:0); |
| 3888 | 3888 | const isPrefix = isContinue && i === coreChat.length - 1; |
| 3889 | 3889 | coreChat[i] = { |
| 3890 | 3890 | ...coreChat[i], |