CC: Actually check if can afford both the block and the header

This commit is contained in:
Cohee 2024-10-12 20:17:20 +03:00
parent a12051ee24
commit 663f4ed798

View File

@ -811,8 +811,7 @@ async function populateDialogueExamples(prompts, chatCompletion, messageExamples
chatMessages.push(chatMessage);
}
const canAffordBlock = chatCompletion.canAfford(newExampleChat) && chatCompletion.canAffordAll(chatMessages);
if (!canAffordBlock) {
if (!chatCompletion.canAffordAll([newExampleChat, ...chatMessages])) {
break;
}