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/4] 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 67c8ec6d7e9bf0857d607660a24dc126862065ad Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Wed, 9 Aug 2023 15:27:08 +0800 Subject: [PATCH 2/4] 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"; From 9834a67cbd5bd0fda85173b0c1a466791521e037 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Wed, 9 Aug 2023 15:37:13 +0800 Subject: [PATCH 3/4] Update tauri.conf.json --- src-tauri/tauri.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index a8a66642a..2ec2c1a84 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "ChatGPT Next Web", - "version": "2.9.2" + "version": "2.9.3" }, "tauri": { "allowlist": { From 0b7de6f7b2fc0043631607dd880e810605b312a9 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Thu, 10 Aug 2023 10:47:06 +0800 Subject: [PATCH 4/4] fix: #2594 trim the / --- app/api/common.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/api/common.ts b/app/api/common.ts index e5afb4d89..cd2936ee3 100644 --- a/app/api/common.ts +++ b/app/api/common.ts @@ -20,6 +20,10 @@ export async function requestOpenai(req: NextRequest) { baseUrl = `${PROTOCOL}://${baseUrl}`; } + if (baseUrl.endsWith('/')) { + baseUrl = baseUrl.slice(0, -1); + } + console.log("[Proxy] ", openaiPath); console.log("[Base Url]", baseUrl);