Просмотр исходного кода

Merge pull request #5621 from ConnectAI-E/hotfix/plugin-result

hotfix plugin result is not string #5614
Lloyd Zhou 1 год назад
Родитель
Сommit
63ab83c3c8
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      app/utils/chat.ts

+ 5 - 0
app/utils/chat.ts

@@ -223,6 +223,11 @@ export function stream(
             )
             )
               .then((res) => {
               .then((res) => {
                 let content = res.data || res?.statusText;
                 let content = res.data || res?.statusText;
+                // hotfix #5614
+                content =
+                  typeof content === "string"
+                    ? content
+                    : JSON.stringify(content);
                 if (res.status >= 300) {
                 if (res.status >= 300) {
                   return Promise.reject(content);
                   return Promise.reject(content);
                 }
                 }