()
| 621 | * give, and pretending otherwise would break the one hard rule here. |
| 622 | */ |
| 623 | const noteFor = (): Card => ({ |
| 624 | id: `K${cards.length + 1}`, |
| 625 | kind: 'absence', |
| 626 | lines: [ |
| 627 | `The token budget of ${budget} stopped this list: ` |
| 628 | + [...droppedByKind.entries()] |
| 629 | .sort((a, b) => (a[0] < b[0] ? -1 : 1)) |
| 630 | .map(([kind, count]) => `${count} more ${labelOf(kind, count)} not listed`) |
| 631 | .join(', ') + '.', |
| 632 | 'Anything not on a card above is not part of what was given.', |
| 633 | ], |
| 634 | }); |
| 635 | let note = noteFor(); |
| 636 | let cost = estimateTokens(renderCard(note)) + 1; |
| 637 | while (tokens + cost > budget && cards.length > 0) { |
no test coverage detected