From 034b7d4655c55ecd5a8e6abd5a130356e4f6b38a Mon Sep 17 00:00:00 2001 From: dupl <67990457+dupl@users.noreply.github.com> Date: Sun, 2 Feb 2025 23:11:07 +0800 Subject: [PATCH 1/7] add gemini-2.0-flash-thinking-exp, gemini-2.0-flash-thinking-exp-01-21 --- app/constant.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/constant.ts b/app/constant.ts index a7567f1d7..141e8f352 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -494,7 +494,9 @@ const googleModels = [ "gemini-exp-1121", "gemini-exp-1206", "gemini-2.0-flash-exp", + "gemini-2.0-flash-thinking-exp", "gemini-2.0-flash-thinking-exp-1219", + "gemini-2.0-flash-thinking-exp-01-21", ]; const anthropicModels = [ From 60fa358010125894dc85f19618081040eccce15c Mon Sep 17 00:00:00 2001 From: dupl <67990457+dupl@users.noreply.github.com> Date: Sun, 2 Feb 2025 23:27:45 +0800 Subject: [PATCH 2/7] typo: OpanAI -> OpenAI --- README_CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_CN.md b/README_CN.md index 9348176e5..b23ea790d 100644 --- a/README_CN.md +++ b/README_CN.md @@ -89,7 +89,7 @@ code1,code2,code3 ### `OPENAI_API_KEY` (必填项) -OpanAI 密钥,你在 openai 账户页面申请的 api key,使用英文逗号隔开多个 key,这样可以随机轮询这些 key。 +OpenAI 密钥,你在 openai 账户页面申请的 api key,使用英文逗号隔开多个 key,这样可以随机轮询这些 key。 ### `CODE` (可选) From 8f12beb8f0b65d9b3de009348b0a8b2397e5574c Mon Sep 17 00:00:00 2001 From: Sky Date: Sun, 2 Feb 2025 21:43:30 +0000 Subject: [PATCH 3/7] support o3-mini --- app/api/openai.ts | 2 +- app/client/platforms/openai.ts | 16 ++++++++-------- app/components/emoji.tsx | 3 ++- app/constant.ts | 1 + 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/api/openai.ts b/app/api/openai.ts index 2b5deca8b..dd820073f 100644 --- a/app/api/openai.ts +++ b/app/api/openai.ts @@ -14,7 +14,7 @@ function getModels(remoteModelRes: OpenAIListModelResponse) { if (config.disableGPT4) { remoteModelRes.data = remoteModelRes.data.filter( (m) => - !(m.id.startsWith("gpt-4") || m.id.startsWith("chatgpt-4o") || m.id.startsWith("o1")) || + !(m.id.startsWith("gpt-4") || m.id.startsWith("chatgpt-4o") || m.id.startsWith("o1")) || m.id.startsWith("o3")) || m.id.startsWith("gpt-4o-mini"), ); } diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index 5a110b84b..467bb82e0 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -195,7 +195,7 @@ export class ChatGPTApi implements LLMApi { let requestPayload: RequestPayload | DalleRequestPayload; const isDalle3 = _isDalle3(options.config.model); - const isO1 = options.config.model.startsWith("o1"); + const isO1OrO3 = options.config.model.startsWith("o1") || options.config.model.startsWith("o3"); if (isDalle3) { const prompt = getMessageTextContent( options.messages.slice(-1)?.pop() as any, @@ -217,7 +217,7 @@ export class ChatGPTApi implements LLMApi { const content = visionModel ? await preProcessImageContent(v.content) : getMessageTextContent(v); - if (!(isO1 && v.role === "system")) + if (!(isO1OrO3 && v.role === "system")) messages.push({ role: v.role, content }); } @@ -226,16 +226,16 @@ export class ChatGPTApi implements LLMApi { messages, stream: options.config.stream, model: modelConfig.model, - temperature: !isO1 ? modelConfig.temperature : 1, - presence_penalty: !isO1 ? modelConfig.presence_penalty : 0, - frequency_penalty: !isO1 ? modelConfig.frequency_penalty : 0, - top_p: !isO1 ? modelConfig.top_p : 1, + temperature: !isO1OrO3 ? modelConfig.temperature : 1, + presence_penalty: !isO1OrO3 ? modelConfig.presence_penalty : 0, + frequency_penalty: !isO1OrO3 ? modelConfig.frequency_penalty : 0, + top_p: !isO1OrO3 ? modelConfig.top_p : 1, // max_tokens: Math.max(modelConfig.max_tokens, 1024), // Please do not ask me why not send max_tokens, no reason, this param is just shit, I dont want to explain anymore. }; // O1 使用 max_completion_tokens 控制token数 (https://platform.openai.com/docs/guides/reasoning#controlling-costs) - if (isO1) { + if (isO1OrO3) { requestPayload["max_completion_tokens"] = modelConfig.max_tokens; } @@ -359,7 +359,7 @@ export class ChatGPTApi implements LLMApi { // make a fetch request const requestTimeoutId = setTimeout( () => controller.abort(), - isDalle3 || isO1 ? REQUEST_TIMEOUT_MS * 4 : REQUEST_TIMEOUT_MS, // dalle3 using b64_json is slow. + isDalle3 || isO1OrO3 ? REQUEST_TIMEOUT_MS * 4 : REQUEST_TIMEOUT_MS, // dalle3 using b64_json is slow. ); const res = await fetch(chatPath, chatPayload); diff --git a/app/components/emoji.tsx b/app/components/emoji.tsx index d75cdda92..54d1c1c99 100644 --- a/app/components/emoji.tsx +++ b/app/components/emoji.tsx @@ -38,7 +38,8 @@ export function Avatar(props: { model?: ModelType; avatar?: string }) {
{props.model?.startsWith("gpt-4") || props.model?.startsWith("chatgpt-4o") || - props.model?.startsWith("o1") ? ( + props.model?.startsWith("o1") || + props.model?.startsWith("o3") ? ( ) : ( diff --git a/app/constant.ts b/app/constant.ts index a7567f1d7..d98b84828 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -410,6 +410,7 @@ export const KnowledgeCutOffDate: Record = { "gpt-4-vision-preview": "2023-04", "o1-mini": "2023-10", "o1-preview": "2023-10", + "o3-mini": "2023-10", // After improvements, // it's now easier to add "KnowledgeCutOffDate" instead of stupid hardcoding it, as was done previously. "gemini-pro": "2023-12", From 4c4d44e2f831ec3296bbfd9f3c9e8b201e6bf18d Mon Sep 17 00:00:00 2001 From: Sky Date: Sun, 2 Feb 2025 21:45:30 +0000 Subject: [PATCH 4/7] fix --- app/api/openai.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/openai.ts b/app/api/openai.ts index dd820073f..e97dfbfe7 100644 --- a/app/api/openai.ts +++ b/app/api/openai.ts @@ -14,7 +14,7 @@ function getModels(remoteModelRes: OpenAIListModelResponse) { if (config.disableGPT4) { remoteModelRes.data = remoteModelRes.data.filter( (m) => - !(m.id.startsWith("gpt-4") || m.id.startsWith("chatgpt-4o") || m.id.startsWith("o1")) || m.id.startsWith("o3")) || + !(m.id.startsWith("gpt-4") || m.id.startsWith("chatgpt-4o") || m.id.startsWith("o1") || m.id.startsWith("o3")) || m.id.startsWith("gpt-4o-mini"), ); } From 92f57fb18fe40e73a425842747d4b5654493f275 Mon Sep 17 00:00:00 2001 From: zcong1993 Date: Mon, 3 Feb 2025 16:58:42 +0800 Subject: [PATCH 5/7] fix: fix isModelNotavailableInServer logic for bytedance models --- app/utils/model.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/utils/model.ts b/app/utils/model.ts index a1a38a2f8..f460babcd 100644 --- a/app/utils/model.ts +++ b/app/utils/model.ts @@ -1,4 +1,4 @@ -import { DEFAULT_MODELS } from "../constant"; +import { DEFAULT_MODELS, ServiceProvider } from "../constant"; import { LLMModel } from "../client/api"; const CustomSeq = { @@ -246,6 +246,11 @@ export function isModelNotavailableInServer( ? providerNames : [providerNames]; for (const providerName of providerNamesArray) { + // if model provider is bytedance, use model config name to check if not avaliable + if (providerName === ServiceProvider.ByteDance) { + return !Object.values(modelTable).filter((v) => v.name === modelName)?.[0] + ?.available; + } const fullName = `${modelName}@${providerName.toLowerCase()}`; if (modelTable?.[fullName]?.available === true) return false; } From 1db4d25370d5754576c2bddc29ee75c6869b2696 Mon Sep 17 00:00:00 2001 From: RiverRay Date: Tue, 4 Feb 2025 09:29:56 +0800 Subject: [PATCH 6/7] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3c23f4993..6df709d96 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@
- icon + icon +

NextChat (ChatGPT Next Web)

English / [简体中文](./README_CN.md) @@ -13,8 +14,7 @@ English / [简体中文](./README_CN.md) ChatGPTNextWeb%2FChatGPT-Next-Web | Trendshift - -One-Click to get a well-designed cross-platform ChatGPT web UI, with Claude, GPT4 & Gemini Pro support. +✨ Light and Fast AI Assistant,with Claude, DeepSeek, GPT4 & Gemini Pro support. [![Saas][Saas-image]][saas-url] [![Web][Web-image]][web-url] @@ -22,7 +22,7 @@ One-Click to get a well-designed cross-platform ChatGPT web UI, with Claude, GPT [![MacOS][MacOS-image]][download-url] [![Linux][Linux-image]][download-url] -[NextChatAI](https://nextchat.dev/chat?utm_source=readme) / [Web App Demo](https://app.nextchat.dev) / [Desktop App](https://github.com/Yidadaa/ChatGPT-Next-Web/releases) / [Discord](https://discord.gg/YCkeafCafC) / [Enterprise Edition](#enterprise-edition) / [Twitter](https://twitter.com/NextChatDev) +[NextChatAI](https://nextchat.dev/chat?utm_source=readme) / [Web App Demo](https://app.nextchat.dev) / [Desktop App](https://github.com/Yidadaa/ChatGPT-Next-Web/releases) [saas-url]: https://nextchat.dev/chat?utm_source=readme @@ -34,9 +34,9 @@ One-Click to get a well-designed cross-platform ChatGPT web UI, with Claude, GPT [MacOS-image]: https://img.shields.io/badge/-MacOS-black?logo=apple [Linux-image]: https://img.shields.io/badge/-Linux-333?logo=ubuntu -[Deploy on Vercel](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FChatGPTNextWeb%2FChatGPT-Next-Web&env=OPENAI_API_KEY&env=CODE&project-name=nextchat&repository-name=NextChat) [Deploy on Zeabur](https://zeabur.com/templates/ZBUEFA) [Open in Gitpod](https://gitpod.io/#https://github.com/Yidadaa/ChatGPT-Next-Web) [BT Deply Install](https://www.bt.cn/new/download.html) +[Deploy on Zeabur](https://zeabur.com/templates/ZBUEFA) [Deploy on Vercel](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FChatGPTNextWeb%2FChatGPT-Next-Web&env=OPENAI_API_KEY&env=CODE&project-name=nextchat&repository-name=NextChat) [Open in Gitpod](https://gitpod.io/#https://github.com/ChatGPTNextWeb/NextChat) -[](https://monica.im/?utm=nxcrp) +[](https://monica.im/?utm=nxcrp)
From 9943a52295e36b0c296110f31643090f5fe0bb35 Mon Sep 17 00:00:00 2001 From: RiverRay Date: Tue, 4 Feb 2025 09:31:16 +0800 Subject: [PATCH 7/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6df709d96..d6e99fca9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@