Skip to content

Commit

Permalink
empty response chunk fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Aug 15, 2024
1 parent 5d0f4dc commit 07af3c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/cli/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ export async function runScript(
partialCb: (args) => {
const { responseChunk, tokensSoFar } = args
tokens = tokensSoFar
if (stream && responseChunk) process.stdout.write(responseChunk)
else if (!isQuiet) process.stderr.write(responseChunk)
if (responseChunk !== undefined) {
if (stream) process.stdout.write(responseChunk)
else if (!isQuiet) process.stderr.write(responseChunk)
}
partialCb?.(args)
},
skipLLM,
Expand Down

0 comments on commit 07af3c5

Please sign in to comment.