| 4028 | async function checkPromptSize() { | 4028 | async function checkPromptSize() { |
| 4029 | console.debug('---checking Prompt size'); | 4029 | console.debug('---checking Prompt size'); |
| 4030 | setPromptString(); | 4030 | setPromptString(); |
| | 4031 | const jointMessages = mesSend.map((e) => `${e.extensionPrompts.join('')}${e.message}`).join(''); |
| 4031 | const prompt = [ | 4032 | const prompt = [ |
| 4032 | beforeScenarioAnchor, | 4033 | beforeScenarioAnchor, |
| 4033 | storyString, | 4034 | storyString, |
| 4034 | afterScenarioAnchor, | 4035 | afterScenarioAnchor, |
| 4035 | mesExmString, | 4036 | mesExmString, |
| 4036 | mesSend.map((e) => `${e.extensionPrompts.join('')}${e.message}`).join(''), | 4037 | addChatsPreamble(addChatsSeparator(jointMessages)), |
| 4037 | '\n', | 4038 | '\n', |
| 4038 | generatedPromptCache, | 4039 | generatedPromptCache, |
| 4039 | quiet_prompt, | 4040 | quiet_prompt, |