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, timeoutMs: options.timeout || undefined,
onProgress: options.stream onProgress: options.stream
? (progress) => { ? (progress) => {
const { text } = progress.detail.choices[0] if (progress.delta) {
process.stdout.write(text) process.stdout.write(progress.delta)
}
} }
: undefined : undefined
}) })