From b9f45c2052fe9f49600d56711e05ee0e16350a24 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Sun, 9 Jul 2023 21:58:49 +0800 Subject: [PATCH] feat: support stream debug log --- apps/chat.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/chat.js b/apps/chat.js index 1fc3e24..4ecf535 100644 --- a/apps/chat.js +++ b/apps/chat.js @@ -1876,7 +1876,13 @@ export class chatgpt extends plugin { this.chatGPTApi = new ChatGPTAPI(opts) let option = { timeoutMs: 120000, - completionParams + completionParams, + stream: true, + onProgress: (data) => { + if (Config.debug) { + logger.info(data?.text || data.functionCall || data) + } + } // systemMessage: promptPrefix } option.systemMessage = system