feat: add chalk styling for terminal output
This commit is contained in:
parent
4bbe1a38d4
commit
712666255a
4 changed files with 21 additions and 5 deletions
5
index.ts
5
index.ts
|
|
@ -2,6 +2,7 @@ import os from "node:os";
|
|||
import { parseArgs } from "node:util";
|
||||
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
|
||||
import { type ModelMessage, streamText } from "ai";
|
||||
import chalk from "chalk";
|
||||
|
||||
import StreamRenderer from "./src/render";
|
||||
|
||||
|
|
@ -101,7 +102,9 @@ async function main() {
|
|||
const output = (outputTokens ?? 0) / 1000;
|
||||
const time = (stop - start) / 1000;
|
||||
process.stderr.write(
|
||||
`\u001b[2mContext: ${context.toFixed(1)}k, Output: ${output.toFixed(1)}k, Time: ${time.toFixed(2)}s\u001b[22m\n`,
|
||||
chalk.dim(
|
||||
`Context: ${context.toFixed(1)}k, Output: ${output.toFixed(1)}k, Time: ${time.toFixed(2)}s\n`,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue