@ducci/jarvis 1.0.80 → 1.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -278,15 +278,19 @@ export async function startTelegramChannel(config) {
|
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
const
|
|
282
|
-
const
|
|
281
|
+
const totalMessages = Math.max(0, session.messages.length - 1); // exclude system prompt
|
|
282
|
+
const windowed = session.messages.length <= config.contextWindow + 1
|
|
283
|
+
? session.messages
|
|
284
|
+
: [session.messages[0], ...session.messages.slice(-config.contextWindow)];
|
|
285
|
+
const inContext = Math.max(0, windowed.length - 1);
|
|
286
|
+
const estimatedTokens = Math.round(JSON.stringify(windowed).length / 4);
|
|
283
287
|
const model = config.selectedModel || 'unknown';
|
|
284
288
|
const contextWindow = config.modelContextWindow || lookupContextWindow(model);
|
|
285
289
|
|
|
286
290
|
let lines = [
|
|
287
291
|
`<b>Context — Slot ${slot}</b>`,
|
|
288
292
|
`Model: <code>${escapeHtml(model)}</code>`,
|
|
289
|
-
`Messages in
|
|
293
|
+
`Messages on disk: ${totalMessages} | in context: ${inContext}`,
|
|
290
294
|
`Estimated tokens: ~${estimatedTokens.toLocaleString()}`,
|
|
291
295
|
];
|
|
292
296
|
|