From 1ef1dd848e1fc0aed7e0169cd42699815793799b Mon Sep 17 00:00:00 2001 From: pelikhan Date: Wed, 11 Dec 2024 07:53:51 -0800 Subject: [PATCH] =?UTF-8?q?refactor:=20remove=20unused=20logging=20logic?= =?UTF-8?q?=20=F0=9F=A7=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/cli/src/run.ts | 1 - packages/core/src/usage.ts | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/cli/src/run.ts b/packages/cli/src/run.ts index 42809d338..8ee9a7522 100644 --- a/packages/cli/src/run.ts +++ b/packages/cli/src/run.ts @@ -410,7 +410,6 @@ export async function runScriptInternal( await aggregateResults(scriptId, outTrace, stats, result) await traceAgentMemory(trace) - stats.log() if (outAnnotations && result.annotations?.length) { if (isJSONLFilename(outAnnotations)) diff --git a/packages/core/src/usage.ts b/packages/core/src/usage.ts index 2ea9a6740..3f1ada183 100644 --- a/packages/core/src/usage.ts +++ b/packages/core/src/usage.ts @@ -254,13 +254,11 @@ export class GenerationStats { * @param indent - The indentation used for logging. */ private logTokens(indent: string) { - if (!this.resolvedModel) return - const unknowns = new Set() const c = this.cost() if (this.model && isNaN(c) && isCosteable(this.model)) unknowns.add(this.model) - if (this.model || c) { + if (this.resolvedModel || c) { const au = this.accumulatedUsage() logVerbose( `${indent}${this.label ? `${this.label} (${this.resolvedModel})` : this.resolvedModel}> ${au.total_tokens} tokens (${au.prompt_tokens} -> ${au.completion_tokens}) ${renderCost(c)}`