Skip to content

Commit

Permalink
hotfix plugin result is not string #5614
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Oct 10, 2024
1 parent 19b42aa commit 268cf3b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/utils/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 268cf3b

Please sign in to comment.