Compare commits

...

17 Commits

Author SHA1 Message Date
Alexey Bogomolov
92bb4c4786 Merge 644e3ea841 into 3809375694 2025-04-22 14:55:15 +08:00
RiverRay
3809375694 Merge pull request #6457 from ACTOR-ALCHEMIST/main
Some checks failed
Run Tests / test (push) Has been cancelled
Support OpenAI o3 and o4-mini
2025-04-19 16:00:41 +08:00
RiverRay
1b0de25986 Update README.md 2025-04-19 15:59:31 +08:00
RiverRay
865c45dd29 Update README.md 2025-04-19 15:56:53 +08:00
RiverRay
1f5d8e6d9c Merge pull request #6458 from ChatGPTNextWeb/Leizhenpeng-patch-7
Update README.md
2025-04-19 15:50:48 +08:00
RiverRay
c9ef6d58ed Update README.md 2025-04-19 15:50:17 +08:00
Jasper Hu
2d7229d2b8 feat: 支持 OpenAI 新模型 o3 与 o4-mini,并适配新参数 2025-04-18 20:36:07 +01:00
Alexey Bogomolov
644e3ea841 Update no.ts 2025-04-15 14:40:07 +03:00
Alexey Bogomolov
012598fa9e Merge branch 'main' into feature/add-disable-autoscroll-option 2025-04-15 14:22:48 +03:00
Alexey Bogomolov
e90c379c1a Merge branch 'ChatGPTNextWeb:main' into feature/add-disable-autoscroll-option 2024-02-16 13:24:20 +03:00
Alexey Bogomolov
8ec222b5e4 check scroll on hit bottom 2024-01-20 18:32:19 +03:00
Alexey Bogomolov
3f79e0879b Update pt.ts 2024-01-12 09:53:37 +03:00
Alexey Bogomolov
4534469d8c update locales 2024-01-12 00:39:57 +03:00
Alexey Bogomolov
434abbc66f use config to drive autoscroll state 2024-01-11 02:19:22 +03:00
Alexey Bogomolov
e186e05c7d update autoscroll config 2024-01-11 02:18:18 +03:00
Alexey Bogomolov
223ff8d1c4 autoscroll enabled by default 2024-01-11 02:17:34 +03:00
Alexey Bogomolov
28f40ebaa1 add menu settings and a rough translation 2024-01-11 02:16:18 +03:00
24 changed files with 110 additions and 15 deletions

View File

@@ -22,7 +22,7 @@ English / [简体中文](./README_CN.md)
[![MacOS][MacOS-image]][download-url]
[![Linux][Linux-image]][download-url]
[NextChatAI](https://nextchat.club?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.club?utm_source=readme) / [iOS APP](https://apps.apple.com/us/app/nextchat-ai/id6743085599) / [Web App Demo](https://app.nextchat.dev) / [Desktop App](https://github.com/Yidadaa/ChatGPT-Next-Web/releases) / [Enterprise Edition](#enterprise-edition)
[saas-url]: https://nextchat.club?utm_source=readme
@@ -40,13 +40,14 @@ English / [简体中文](./README_CN.md)
</div>
## 🥳 Cheer for DeepSeek, China's AI star!
> Purpose-Built UI for DeepSeek Reasoner Model
## 🥳 Cheer for NextChat iOS Version Online!
> [👉 Click Here to Install Now](https://apps.apple.com/us/app/nextchat-ai/id6743085599)
> [❤️ Source Code Coming Soon](https://github.com/ChatGPTNextWeb/NextChat-iOS)
![Github iOS Image](https://github.com/user-attachments/assets/e0aa334f-4c13-4dc9-8310-e3b09fa4b9f3)
<img src="https://github.com/user-attachments/assets/f3952210-3af1-4dc0-9b81-40eaa4847d9a"/>
## 🫣 NextChat Support MCP !
> Before build, please set env ENABLE_MCP=true

View File

@@ -198,7 +198,8 @@ export class ChatGPTApi implements LLMApi {
const isDalle3 = _isDalle3(options.config.model);
const isO1OrO3 =
options.config.model.startsWith("o1") ||
options.config.model.startsWith("o3");
options.config.model.startsWith("o3") ||
options.config.model.startsWith("o4-mini");
if (isDalle3) {
const prompt = getMessageTextContent(
options.messages.slice(-1)?.pop() as any,
@@ -243,7 +244,7 @@ export class ChatGPTApi implements LLMApi {
}
// add max_tokens to vision model
if (visionModel) {
if (visionModel && !isO1OrO3) {
requestPayload["max_tokens"] = Math.max(modelConfig.max_tokens, 4000);
}
}

View File

@@ -449,7 +449,6 @@ export function ChatAction(props: {
</div>
);
}
function useScrollToBottom(
scrollRef: RefObject<HTMLDivElement>,
detach: boolean = false,
@@ -457,15 +456,18 @@ function useScrollToBottom(
) {
// for auto-scroll
const [autoScroll, setAutoScroll] = useState(true);
const config = useAppConfig();
const isAutoScrollEnabled: boolean = config.autoScrollMessage;
const scrollDomToBottom = useCallback(() => {
const dom = scrollRef.current;
if (dom) {
requestAnimationFrame(() => {
setAutoScroll(true);
setAutoScroll(isAutoScrollEnabled);
dom.scrollTo(0, dom.scrollHeight);
});
}
}, [scrollRef]);
}, [scrollRef, isAutoScrollEnabled]);
// auto scroll
useEffect(() => {
@@ -490,7 +492,6 @@ function useScrollToBottom(
scrollDomToBottom,
};
}
export function ChatActions(props: {
uploadImage: () => void;
setAttachImages: (images: string[]) => void;
@@ -1420,7 +1421,8 @@ function _Chat() {
}
setHitBottom(isHitBottom);
setAutoScroll(isHitBottom);
let isAutoScrollEnabled: boolean = config.autoScrollMessage;
setAutoScroll(isAutoScrollEnabled);
};
function scrollToBottom() {

View File

@@ -1666,7 +1666,21 @@ export function Settings() {
}
></input>
</ListItem>
<ListItem
title={Locale.Settings.AutoScrollMessage.Title}
subTitle={Locale.Settings.AutoScrollMessage.SubTitle}
>
<input
type="checkbox"
checked={config.autoScrollMessage}
onChange={(e) =>
updateConfig(
(config) =>
(config.autoScrollMessage = e.currentTarget.checked),
)
}
></input>
</ListItem>
<ListItem
title={Locale.Mask.Config.Artifacts.Title}
subTitle={Locale.Mask.Config.Artifacts.SubTitle}

View File

@@ -478,6 +478,8 @@ export const VISION_MODEL_REGEXES = [
/^dall-e-3$/, // Matches exactly "dall-e-3"
/glm-4v/,
/vl/i,
/o3/,
/o4-mini/,
];
export const EXCLUDE_VISION_MODEL_REGEXES = [/claude-3-5-haiku-20241022/];
@@ -516,6 +518,8 @@ const openaiModels = [
"o1-mini",
"o1-preview",
"o3-mini",
"o3",
"o4-mini",
];
const googleModels = [

View File

@@ -242,6 +242,10 @@ const ar: PartialLocaleType = {
},
ImportFailed: "فشل الاستيراد",
},
AutoScrollMessage: {
Title: "الرد التلقائي للتمرير",
SubTitle: "تمرير الرسالة أثناء الرد",
},
Mask: {
Splash: {
Title: "صفحة بدء القناع",

View File

@@ -245,6 +245,10 @@ const bn: PartialLocaleType = {
},
ImportFailed: "আমদানি ব্যর্থ",
},
AutoScrollMessage: {
Title: "অটো-স্ক্রল উত্তর",
SubTitle: "উত্তর দেওয়ার সময় বার্তা স্ক্রল করুন",
},
Mask: {
Splash: {
Title: "মাস্ক লঞ্চ পেজ",

View File

@@ -216,6 +216,10 @@ const cn = {
Title: "预览气泡",
SubTitle: "在预览气泡中预览 Markdown 内容",
},
AutoScrollMessage: {
Title: "自动滚动回复",
SubTitle: "滚动消息以进行回复",
},
AutoGenerateTitle: {
Title: "自动生成标题",
SubTitle: "根据对话内容生成合适的标题",

View File

@@ -244,6 +244,10 @@ const cs: PartialLocaleType = {
},
ImportFailed: "Import selhal",
},
AutoScrollMessage: {
Title: "Automatické rolování odpovědi",
SubTitle: "Rolovat zprávu při odpovídání",
},
Mask: {
Splash: {
Title: "Úvodní stránka masky",

View File

@@ -249,6 +249,10 @@ const de: PartialLocaleType = {
},
ImportFailed: "Import fehlgeschlagen",
},
AutoScrollMessage: {
Title: "Auto-Scroll-Antwort",
SubTitle: "Nachricht beim Antworten scrollen",
},
Mask: {
Splash: {
Title: "Masken-Startseite",

View File

@@ -218,6 +218,10 @@ const en: LocaleType = {
Title: "Send Preview Bubble",
SubTitle: "Preview markdown in bubble",
},
AutoScrollMessage: {
Title: "Auto-Scroll Reply",
SubTitle: "Scroll the message during reply",
},
AutoGenerateTitle: {
Title: "Auto Generate Title",
SubTitle: "Generate a suitable title based on the conversation content",

View File

@@ -252,6 +252,10 @@ const es: PartialLocaleType = {
},
ImportFailed: "Importación fallida",
},
AutoScrollMessage: {
Title: "Respuesta con Auto-Desplazamiento",
SubTitle: "Desplazar el mensaje durante la respuesta",
},
Mask: {
Splash: {
Title: "Pantalla de inicio de máscara",

View File

@@ -252,6 +252,10 @@ const fr: PartialLocaleType = {
},
ImportFailed: "Échec de l'importation",
},
AutoScrollMessage: {
Title: "Réponse défilement automatique",
SubTitle: "Faire défiler le message lors de la réponse",
},
Mask: {
Splash: {
Title: "Page de démarrage du masque",

View File

@@ -245,6 +245,10 @@ const id: PartialLocaleType = {
},
ImportFailed: "Impor Gagal",
},
AutoScrollMessage: {
Title: "Balasan Auto-Scroll",
SubTitle: "Gulir pesan saat membalas",
},
Mask: {
Splash: {
Title: "Halaman Awal Masker",

View File

@@ -253,6 +253,10 @@ const it: PartialLocaleType = {
},
ImportFailed: "Importazione fallita",
},
AutoScrollMessage: {
Title: "Risposta Auto-Scroll",
SubTitle: "Scorri il messaggio durante la risposta",
},
Mask: {
Splash: {
Title: "Pagina di avvio delle maschere",

View File

@@ -244,6 +244,10 @@ const jp: PartialLocaleType = {
},
ImportFailed: "インポートに失敗しました",
},
AutoScrollMessage: {
Title: "オートスクロール返信",
SubTitle: "返信中にメッセージをスクロール",
},
Mask: {
Splash: {
Title: "マスク起動画面",

View File

@@ -243,6 +243,10 @@ const ko: PartialLocaleType = {
},
ImportFailed: "가져오기 실패",
},
AutoScrollMessage: {
Title: "자동 스크롤 답장",
SubTitle: "답장하는 동안 메시지 스크롤",
},
Mask: {
Splash: {
Title: "마스크 시작 페이지",

View File

@@ -195,6 +195,10 @@ const pt: PartialLocaleType = {
Title: "Bolha de Pré-visualização de Envio",
SubTitle: "Pré-visualizar markdown na bolha",
},
AutoScrollMessage: {
Title: "Resposta de rolagem automática",
SubTitle: "Rolar a mensagem enquanto responde",
},
AutoGenerateTitle: {
Title: "Gerar Título Automaticamente",
SubTitle: "Gerar um título adequado baseado no conteúdo da conversa",

View File

@@ -246,6 +246,10 @@ const ru: PartialLocaleType = {
},
ImportFailed: "Не удалось импортировать",
},
AutoScrollMessage: {
Title: "Автопрокрутка ответа",
SubTitle: "Прокрутка сообщения во время ответа",
},
Mask: {
Splash: {
Title: "Стартовая страница масок",

View File

@@ -196,6 +196,10 @@ const sk: PartialLocaleType = {
Title: "Bublina náhľadu odoslania",
SubTitle: "Náhľad markdownu v bubline",
},
AutoScrollMessage: {
Title: "Odpoveď s automatickým posúvaním",
SubTitle: "Posúvať správu počas odpovedania",
},
AutoGenerateTitle: {
Title: "Automaticky generovať názov",
SubTitle: "Generovať vhodný názov na základe obsahu konverzácie",

View File

@@ -244,6 +244,10 @@ const tr: PartialLocaleType = {
},
ImportFailed: "İçeri aktarma başarısız",
},
AutoScrollMessage: {
Title: "Otomatik Kaydırma Yanıtı",
SubTitle: "Yanıt verirken mesajı kaydır",
},
Mask: {
Splash: {
Title: "Maske Başlangıç Sayfası",

View File

@@ -203,6 +203,10 @@ const tw = {
Title: "預覽氣泡",
SubTitle: "在預覽氣泡中預覽 Markdown 內容",
},
AutoScrollMessage: {
Title: "自動滾動回覆",
SubTitle: "回覆時滾動訊息",
},
AutoGenerateTitle: {
Title: "自動產生標題",
SubTitle: "根據對話內容產生合適的標題",

View File

@@ -244,6 +244,10 @@ const vi: PartialLocaleType = {
},
ImportFailed: "Nhập không thành công",
},
AutoScrollMessage: {
Title: "Trả lời Tự động Cuộn",
SubTitle: "Cuộn tin nhắn khi trả lời",
},
Mask: {
Splash: {
Title: "Trang khởi động mặt nạ",

View File

@@ -48,6 +48,7 @@ export const DEFAULT_CONFIG = {
theme: Theme.Auto as Theme,
tightBorder: !!config?.isApp,
sendPreviewBubble: true,
autoScrollMessage: true,
enableAutoGenerateTitle: true,
sidebarWidth: DEFAULT_SIDEBAR_WIDTH,