CC: Actually check if can afford both the block and the header
| @@ -811,8 +811,7 @@ async function populateDialogueExamples(prompts, chatCompletion, messageExamples | ||
| 811 | 811 | chatMessages.push(chatMessage); |
| 812 | 812 | } |
| 813 | 813 | |
| 814 | - const canAffordBlock = chatCompletion.canAfford(newExampleChat) && chatCompletion.canAffordAll(chatMessages); | |
| 814 | + if (!chatCompletion.canAffordAll([newExampleChat, ...chatMessages])) { | |
| 815 | - if (!canAffordBlock) { | |
| 816 | 815 | break; |
| 817 | 816 | } |
| 818 | 817 | |