From f3b508c08831544b5a17bf8f1d40fabbd1b62b21 Mon Sep 17 00:00:00 2001 From: Zhang Yichi <66503962+ZhangYichi-ZYc@users.noreply.github.com> Date: Thu, 3 Aug 2023 23:52:18 +0800 Subject: [PATCH 1/7] Update Model Pricing.md OpenAI has updated their model prices, reducing the input of GPT-3.5 to $0.0015/1000 tokens --- docs/faq-cn.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/faq-cn.md b/docs/faq-cn.md index e4aa1e774..f9463eb95 100644 --- a/docs/faq-cn.md +++ b/docs/faq-cn.md @@ -212,7 +212,8 @@ OpenAI 网站计费说明:https://openai.com/pricing#language-models OpenAI 根据 token 数收费,1000 个 token 通常可代表 750 个英文单词,或 500 个汉字。输入(Prompt)和输出(Completion)分别统计费用。 |模型|用户输入(Prompt)计费|模型输出(Completion)计费|每次交互最大 token 数| |----|----|----|----| -|gpt-3.5|$0.002 / 1 千 tokens|$0.002 / 1 千 tokens|4096| +|gpt-3.5-turbo|$0.0015 / 1 千 tokens|$0.002 / 1 千 tokens|4096| +|gpt-3.5-turbo-16K|$0.003 / 1 千 tokens|$0.004 / 1 千 tokens|16384| |gpt-4|$0.03 / 1 千 tokens|$0.06 / 1 千 tokens|8192| |gpt-4-32K|$0.06 / 1 千 tokens|$0.12 / 1 千 tokens|32768| From d1096582a50887363554ad7f60821209326b6bbb Mon Sep 17 00:00:00 2001 From: 7lsu Date: Mon, 7 Aug 2023 17:44:32 +0800 Subject: [PATCH 2/7] font family display enhance --- app/components/home.tsx | 3 +-- app/styles/globals.scss | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/components/home.tsx b/app/components/home.tsx index b3cec893e..c6829c2dc 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -104,8 +104,7 @@ const loadAsyncGoogleFont = () => { getClientConfig()?.buildMode === "export" ? remoteFontUrl : proxyFontUrl; linkEl.rel = "stylesheet"; linkEl.href = - googleFontUrl + - "/css2?family=Noto+Sans+SC:wght@300;400;700;900&display=swap"; + googleFontUrl + "/css2?family=Noto+Sans:wght@300;400;700;900&display=swap"; document.head.appendChild(linkEl); }; diff --git a/app/styles/globals.scss b/app/styles/globals.scss index 0417087e9..6542ca6ec 100644 --- a/app/styles/globals.scss +++ b/app/styles/globals.scss @@ -89,7 +89,7 @@ html { height: var(--full-height); - font-family: "Noto Sans SC", "SF Pro SC", "SF Pro Text", "SF Pro Icons", + font-family: "Noto Sans", "SF Pro SC", "SF Pro Text", "SF Pro Icons", "PingFang SC", "Helvetica Neue", "Helvetica", "Arial", sans-serif; } From 769c2f9f49b1fd0d0e8e30b3bf579805c6259b7b Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Tue, 8 Aug 2023 21:22:41 +0800 Subject: [PATCH 3/7] 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 f06c59481..ef68f7d9e 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 4/7] 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 ef68f7d9e..a61765899 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 5/7] 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 3146b6bd9..e5afb4d89 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, From 153e7ac7e4fc2ceb6ec14137812f6f26e862fd9a Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Wed, 9 Aug 2023 01:22:48 +0900 Subject: [PATCH 6/7] Fix typo in README.md notifictions -> notifications --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f0f298fb9..55e88d90e 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ After forking the project, due to the limitations imposed by GitHub, you need to If you want to update instantly, you can check out the [GitHub documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) to learn how to synchronize a forked project with upstream code. -You can star or watch this project or follow author to get release notifictions in time. +You can star or watch this project or follow author to get release notifications in time. ## Access Password From 67c8ec6d7e9bf0857d607660a24dc126862065ad Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Wed, 9 Aug 2023 15:27:08 +0800 Subject: [PATCH 7/7] chore: change ACCESS_CODE_PREFIX to nk- --- app/constant.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/constant.ts b/app/constant.ts index 0a94eed4e..8b28af323 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -41,7 +41,7 @@ export const MAX_SIDEBAR_WIDTH = 500; export const MIN_SIDEBAR_WIDTH = 230; export const NARROW_SIDEBAR_WIDTH = 100; -export const ACCESS_CODE_PREFIX = "ak-"; +export const ACCESS_CODE_PREFIX = "nk-"; export const LAST_INPUT_KEY = "last-input";