fix: cli streaming issue

chatgpt-api
Travis Fischer 2023-03-01 21:50:22 -06:00
rodzic 9979481a12
commit a5375e5d55
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -87,8 +87,9 @@ async function main() {
timeoutMs: options.timeout || undefined,
onProgress: options.stream
? (progress) => {
const { text } = progress.detail.choices[0]
process.stdout.write(text)
if (progress.delta) {
process.stdout.write(progress.delta)
}
}
: undefined
})