ソースを参照

Merge pull request #2585 from Yidadaa/bugfix-0808

Yifei Zhang 1 年間 前
コミット
9420fd4946
2 ファイル変更4 行追加2 行削除
  1. 2 0
      app/api/common.ts
  2. 2 2
      app/store/chat.ts

+ 2 - 0
app/api/common.ts

@@ -43,6 +43,8 @@ export async function requestOpenai(req: NextRequest) {
     },
     method: req.method,
     body: req.body,
+    // to fix #2485: https://stackoverflow.com/questions/55920957/cloudflare-worker-typeerror-one-time-use-body
+    redirect: "manual",
     // @ts-ignore
     duplex: "half",
     signal: controller.signal,

+ 2 - 2
app/store/chat.ts

@@ -332,7 +332,7 @@ export const useChatStore = create<ChatStore>()(
           },
           onError(error) {
             const isAborted = error.message.includes("aborted");
-            botMessage.content =
+            botMessage.content +=
               "\n\n" +
               prettyObject({
                 error: true,
@@ -553,7 +553,7 @@ export const useChatStore = create<ChatStore>()(
                 date: "",
               }),
             ),
-            config: { ...modelConfig, stream: true },
+            config: { ...modelConfig, stream: true, model: "gpt-3.5-turbo" },
             onUpdate(message) {
               session.memoryPrompt = message;
             },