From 769c2f9f49b1fd0d0e8e30b3bf579805c6259b7b Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Tue, 8 Aug 2023 21:22:41 +0800 Subject: [PATCH 1/3] feat: close #2583 do not summarize with gpt-4 --- app/store/chat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/store/chat.ts b/app/store/chat.ts index f06c59481da..ef68f7d9e52 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -553,7 +553,7 @@ export const useChatStore = create()( date: "", }), ), - config: { ...modelConfig, stream: true }, + config: { ...modelConfig, stream: true, model: "gpt-3.5-turbo" }, onUpdate(message) { session.memoryPrompt = message; }, From 4ab9141429ba170308443284bd06c84dac027788 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Tue, 8 Aug 2023 21:24:45 +0800 Subject: [PATCH 2/3] fix: #2564 should not clear message when error --- app/store/chat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/store/chat.ts b/app/store/chat.ts index ef68f7d9e52..a6176589918 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -332,7 +332,7 @@ export const useChatStore = create()( }, onError(error) { const isAborted = error.message.includes("aborted"); - botMessage.content = + botMessage.content += "\n\n" + prettyObject({ error: true, From b14c5cd89c760ac81b555c0b4eb061c34cae6978 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Tue, 8 Aug 2023 21:36:37 +0800 Subject: [PATCH 3/3] fix: #2485 one-time-use body --- app/api/common.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/api/common.ts b/app/api/common.ts index 3146b6bd99d..e5afb4d89f4 100644 --- a/app/api/common.ts +++ b/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,