Skip to content

Commit

Permalink
Merge pull request #29 from peterdanwan/stderr
Browse files Browse the repository at this point in the history
fix: token information uses console.error() instead console.log()
  • Loading branch information
peterdanwan authored Sep 21, 2024
2 parents 06b68ec + d5787dc commit 9c0b43f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ai.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ function displayTokens(usage) {
const completionTokens = usage.candidatesTokenCount || 0;
const promptTokens = usage.promptTokenCount || 0;

console.log();
console.log(chalk.blue('Tokens Used:'));
console.log(`${chalk.yellow('Prompt Tokens:')} ${promptTokens}`);
console.log(`${chalk.yellow('Completion Tokens:')} ${completionTokens}`);
console.log(`${chalk.yellow('Total Tokens:')} ${totalTokens}`);
console.error();
console.error(chalk.blue('Tokens Used:'));
console.error(`${chalk.yellow('Prompt Tokens:')} ${promptTokens}`);
console.error(`${chalk.yellow('Completion Tokens:')} ${completionTokens}`);
console.error(`${chalk.yellow('Total Tokens:')} ${totalTokens}`);
}

0 comments on commit 9c0b43f

Please sign in to comment.