From 268cf3b6066d35f3f6d0acfbb066e07f2139c306 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Thu, 10 Oct 2024 12:47:25 +0800 Subject: [PATCH] hotfix plugin result is not string #5614 --- app/utils/chat.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/utils/chat.ts b/app/utils/chat.ts index 46f23263895..cf9b7af41d3 100644 --- a/app/utils/chat.ts +++ b/app/utils/chat.ts @@ -223,6 +223,11 @@ export function stream( ) .then((res) => { let content = res.data || res?.statusText; + // hotfix #5614 + content = + typeof content === "string" + ? content + : JSON.stringify(content); if (res.status >= 300) { return Promise.reject(content); }