From 856976c03c44afb9fa92ac8b0df34b78f7883dce Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Fri, 10 Nov 2023 11:29:18 +0800 Subject: [PATCH] fix fetch resp msg --- src/chatgpt.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chatgpt.ts b/src/chatgpt.ts index f8c3f59..9affb8d 100644 --- a/src/chatgpt.ts +++ b/src/chatgpt.ts @@ -277,7 +277,7 @@ class Chat { this.forgetSomeMessages(); } - let content = ""; + let content = resp.choices[0].message?.content ?? ""; if ( !resp.choices[0]?.message?.content && !resp.choices[0]?.message?.tool_calls