Elffuss BraidHub

kikocis/continue public

chore: format
Changesetb1590629c521eef8398b14f7ff47979ba189ebc95d675e8378acf49c0f75cd44
AuthorNate <sestinj@gmail.com> · 2025-08-24 15:25 -07:00
CommitterNate <sestinj@gmail.com> · 2025-08-24 15:25 -07:00
Parentsf8084aff9bdd

Browse the files at this changeset

1 file changed

modified core/util/TokensBatchingService.ts +12 −5
@@ -13,7 +13,7 @@
1313 private static instance: TokensBatchingService;
1414 private batches = new Map<string, TokenBatch>();
1515 private flushTimer: NodeJS.Timeout | null = null;
16-
16+
1717 private readonly BATCH_SIZE_LIMIT = 25;
1818 private readonly FLUSH_INTERVAL_MS = 10 * 60 * 1000; // 10 minutes
1919
@@ -28,9 +28,14 @@
2828 this.startFlushTimer();
2929 }
3030
31- addTokens(model: string, provider: string, promptTokens: number, generatedTokens: number): void {
31+ addTokens(
32+ model: string,
33+ provider: string,
34+ promptTokens: number,
35+ generatedTokens: number,
36+ ): void {
3237 const key = `${provider}:${model}`;
33-
38+
3439 if (!this.batches.has(key)) {
3540 this.batches.set(key, {
3641 model,
@@ -66,7 +71,9 @@
6671 totalPromptTokens: batch.totalPromptTokens,
6772 totalGeneratedTokens: batch.totalGeneratedTokens,
6873 avgPromptTokens: Math.round(batch.totalPromptTokens / batch.count),
69- avgGeneratedTokens: Math.round(batch.totalGeneratedTokens / batch.count),
74+ avgGeneratedTokens: Math.round(
75+ batch.totalGeneratedTokens / batch.count,
76+ ),
7077 },
7178 true,
7279 );
@@ -93,4 +100,4 @@
93100 }
94101 this.flushAllBatches();
95102 }
96-}
No newline at the end of the file
103+}