Skip to content

Commit

Permalink
refactor: remove unused logging logic 🧹
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Dec 11, 2024
1 parent 680d579 commit 1ef1dd8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion packages/cli/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>()
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)}`
Expand Down

0 comments on commit 1ef1dd8

Please sign in to comment.