refactor: redirect reasoning output to stderr
This commit is contained in:
parent
712666255a
commit
4716712a92
2 changed files with 38 additions and 38 deletions
22
index.ts
22
index.ts
|
|
@ -78,25 +78,19 @@ async function main() {
|
|||
});
|
||||
|
||||
const start = Date.now();
|
||||
|
||||
const streamRender = new StreamRenderer().renderStream(fullStream);
|
||||
|
||||
const [width] = process.stdout.getWindowSize();
|
||||
const glow = Bun.spawn({
|
||||
cmd: ["glow", "-w", `${width}`, "-"],
|
||||
stdin: textStream,
|
||||
stdout: "inherit",
|
||||
});
|
||||
|
||||
await streamRender;
|
||||
|
||||
await new StreamRenderer().renderStream(fullStream);
|
||||
const stop = Date.now();
|
||||
|
||||
await glow.exited;
|
||||
|
||||
convo.messages.push({ role: "assistant", content: await text });
|
||||
await convoFile.write(JSON.stringify(convo));
|
||||
|
||||
const [width] = process.stdout.getWindowSize();
|
||||
await Bun.spawn({
|
||||
cmd: ["glow", "-w", `${width}`, "-"],
|
||||
stdin: textStream,
|
||||
stdout: "inherit",
|
||||
}).exited;
|
||||
|
||||
const { inputTokens, outputTokens } = await totalUsage;
|
||||
const context = (inputTokens ?? 0) / 1000;
|
||||
const output = (outputTokens ?? 0) / 1000;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue