Merge remote-tracking branch 'origin/main' into users

This commit is contained in:
sijinhui 2024-03-24 19:01:56 +08:00
commit d6b5c86e84
2 changed files with 4 additions and 0 deletions

View File

@ -101,6 +101,7 @@ async function handle(
authorization: req.headers.get("authorization") ?? "",
},
body: shouldNotHaveBody ? null : req.body,
redirect: 'manual',
method,
// @ts-ignore
duplex: "half",

View File

@ -156,6 +156,9 @@ export class ChatGPTApi implements LLMApi {
if (finished || controller.signal.aborted) {
responseText += remainText;
console.log("[Response Animation] finished");
if (responseText?.length === 0) {
options.onError?.(new Error("empty response from server"));
}
return;
}