Compare commits

...

17 Commits

Author SHA1 Message Date
Alexey Bogomolov
dc7f28b618
Merge 644e3ea841 into 995bef73de 2025-08-20 02:32:52 +08:00
RiverRay
995bef73de
Merge pull request #6599 from DreamRivulet/add-support-GPT5
Some checks failed
Run Tests / test (push) Has been cancelled
add: model gpt-5
2025-08-10 17:21:12 +08:00
Sam
38ac502d80 Add support for GPT5 2025-08-09 17:03:49 +08:00
Sam
0511808900 use max_completion_tokens 2025-08-09 17:03:49 +08:00
Sam
42eff644b4 use max_completion_tokens 2025-08-09 17:03:49 +08:00
Sam
8ae6883784 add gpt-5 2025-08-09 17:03:49 +08:00
Sam
c0f2ab6de3 add gpt-5 2025-08-09 17:03:06 +08: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
23 changed files with 112 additions and 9 deletions

View File

@ -200,6 +200,7 @@ export class ChatGPTApi implements LLMApi {
options.config.model.startsWith("o1") ||
options.config.model.startsWith("o3") ||
options.config.model.startsWith("o4-mini");
const isGpt5 = options.config.model.startsWith("gpt-5");
if (isDalle3) {
const prompt = getMessageTextContent(
options.messages.slice(-1)?.pop() as any,
@ -230,7 +231,7 @@ export class ChatGPTApi implements LLMApi {
messages,
stream: options.config.stream,
model: modelConfig.model,
temperature: !isO1OrO3 ? modelConfig.temperature : 1,
temperature: (!isO1OrO3 && !isGpt5) ? modelConfig.temperature : 1,
presence_penalty: !isO1OrO3 ? modelConfig.presence_penalty : 0,
frequency_penalty: !isO1OrO3 ? modelConfig.frequency_penalty : 0,
top_p: !isO1OrO3 ? modelConfig.top_p : 1,
@ -238,7 +239,13 @@ export class ChatGPTApi implements LLMApi {
// Please do not ask me why not send max_tokens, no reason, this param is just shit, I dont want to explain anymore.
};
if (isO1OrO3) {
if (isGpt5) {
// Remove max_tokens if present
delete requestPayload.max_tokens;
// Add max_completion_tokens (or max_completion_tokens if that's what you meant)
requestPayload["max_completion_tokens"] = modelConfig.max_tokens;
} else if (isO1OrO3) {
// by default the o1/o3 models will not attempt to produce output that includes markdown formatting
// manually add "Formatting re-enabled" developer message to encourage markdown inclusion in model responses
// (https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/reasoning?tabs=python-secure#markdown-output)
@ -251,8 +258,9 @@ export class ChatGPTApi implements LLMApi {
requestPayload["max_completion_tokens"] = modelConfig.max_tokens;
}
// add max_tokens to vision model
if (visionModel && !isO1OrO3) {
if (visionModel && !isO1OrO3 && ! isGpt5) {
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

@ -1707,7 +1707,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

@ -493,6 +493,7 @@ export const VISION_MODEL_REGEXES = [
/o3/,
/o4-mini/,
/grok-4/i,
/gpt-5/
];
export const EXCLUDE_VISION_MODEL_REGEXES = [/claude-3-5-haiku-20241022/];
@ -517,6 +518,11 @@ const openaiModels = [
"gpt-4.1-nano-2025-04-14",
"gpt-4.5-preview",
"gpt-4.5-preview-2025-02-27",
"gpt-5-chat",
"gpt-5-mini",
"gpt-5-nano",
"gpt-5",
"gpt-5-chat-2025-01-01-preview",
"gpt-4o",
"gpt-4o-2024-05-13",
"gpt-4o-2024-08-06",

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

@ -264,6 +264,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,