mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-30 01:36:55 +08:00
Compare commits
7 Commits
v2.16.1
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
|
8b73a3626b | ||
|
995bef73de | ||
|
38ac502d80 | ||
|
0511808900 | ||
|
42eff644b4 | ||
|
8ae6883784 | ||
|
c0f2ab6de3 |
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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",
|
||||
|
@@ -56,7 +56,7 @@
|
||||
"spark-md5": "^3.0.2",
|
||||
"use-debounce": "^9.0.4",
|
||||
"zod": "^3.24.1",
|
||||
"zustand": "^4.3.8"
|
||||
"zustand": "^5.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/api": "^2.1.1",
|
||||
|
12
yarn.lock
12
yarn.lock
@@ -8328,7 +8328,7 @@ use-memo-one@^1.1.3:
|
||||
resolved "https://registry.npmmirror.com/use-memo-one/-/use-memo-one-1.1.3.tgz#2fd2e43a2169eabc7496960ace8c79efef975e99"
|
||||
integrity sha512-g66/K7ZQGYrI6dy8GLpVcMsBp4s17xNkYJVSMvTEevGy3nDxHOfE6z8BVE22+5G5x7t3+bhzrlTDB7ObrEE0cQ==
|
||||
|
||||
use-sync-external-store@1.2.0, use-sync-external-store@^1.0.0:
|
||||
use-sync-external-store@^1.0.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a"
|
||||
integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==
|
||||
@@ -8637,12 +8637,10 @@ zod@^3.23.8, zod@^3.24.1:
|
||||
resolved "https://registry.yarnpkg.com/zod/-/zod-3.24.1.tgz#27445c912738c8ad1e9de1bea0359fa44d9d35ee"
|
||||
integrity sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==
|
||||
|
||||
zustand@^4.3.8:
|
||||
version "4.3.8"
|
||||
resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.3.8.tgz#37113df8e9e1421b0be1b2dca02b49b76210e7c4"
|
||||
integrity sha512-4h28KCkHg5ii/wcFFJ5Fp+k1J3gJoasaIbppdgZFO4BPJnsNxL0mQXBSFgOgAdCdBj35aDTPvdAJReTMntFPGg==
|
||||
dependencies:
|
||||
use-sync-external-store "1.2.0"
|
||||
zustand@^5.0.8:
|
||||
version "5.0.8"
|
||||
resolved "https://registry.yarnpkg.com/zustand/-/zustand-5.0.8.tgz#b998a0c088c7027a20f2709141a91cb07ac57f8a"
|
||||
integrity sha512-gyPKpIaxY9XcO2vSMrLbiER7QMAMGOQZVRdJ6Zi782jkbzZygq5GI9nG8g+sMgitRtndwaBSl7uiqC49o1SSiw==
|
||||
|
||||
zwitch@^2.0.0:
|
||||
version "2.0.4"
|
||||
|
Reference in New Issue
Block a user