Compare commits

...

11 Commits

Author SHA1 Message Date
takestairs
d994044380
Merge 812c1c770c into c30ddfbb07 2025-06-14 05:56:44 +08:00
RiverRay
c30ddfbb07
Merge pull request #6425 from yunlingz/o_model_md_response
Some checks failed
Run Tests / test (push) Has been cancelled
Fix: Encourage markdown inclusion in model responses for o1/o3
2025-06-12 11:19:24 +08:00
RiverRay
a2f0149786
Merge pull request #6460 from dreamsafari/main
加入Grok3模型列表
2025-06-12 11:13:31 +08:00
GH Action - Upstream Sync
03d36f96ed Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2025-06-12 01:53:30 +00:00
RiverRay
705dffc664
Merge pull request #6514 from KevinShiCN/patch-1
Some checks failed
Run Tests / test (push) Has been cancelled
Add gemini-2.5-pro-preview-06-05 into constant.ts
2025-06-11 16:14:09 +08:00
KevinShiCN
02f7e6de98
Add gemini-2.5-pro-preview-06-05 into constant.ts 2025-06-08 23:59:49 +08:00
dreamsafari
843dc52efa
加入Grok3模型列表 2025-04-22 13:06:54 +08:00
Yunling Zhu
c261ebc82c use unshift to improve perf 2025-04-06 16:56:54 +08:00
Yunling Zhu
f7c747c65f encourage markdown inclusion for o1/o3 2025-04-03 22:11:59 +08:00
unknown
812c1c770c plugin schema 地址切换至 jsdelivr CDN 2025-02-18 22:13:56 +08:00
unknown
54e3753d93 切换jsdelivr镜像,更新prompts列表 2025-02-18 20:49:28 +08:00
5 changed files with 571 additions and 362 deletions

View File

@ -56,7 +56,7 @@ export interface OpenAIListModelResponse {
export interface RequestPayload {
messages: {
role: "system" | "user" | "assistant";
role: "developer" | "system" | "user" | "assistant";
content: string | MultimodalContent[];
}[];
stream?: boolean;
@ -238,8 +238,16 @@ 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.
};
// O1 使用 max_completion_tokens 控制token数 (https://platform.openai.com/docs/guides/reasoning#controlling-costs)
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)
requestPayload["messages"].unshift({
role: "developer",
content: "Formatting re-enabled",
});
// o1/o3 uses max_completion_tokens to control the number of tokens (https://platform.openai.com/docs/guides/reasoning#controlling-costs)
requestPayload["max_completion_tokens"] = modelConfig.max_tokens;
}

View File

@ -546,6 +546,7 @@ const googleModels = [
"gemini-2.0-flash-thinking-exp-01-21",
"gemini-2.0-pro-exp",
"gemini-2.0-pro-exp-02-05",
"gemini-2.5-pro-preview-06-05",
];
const anthropicModels = [
@ -632,6 +633,18 @@ const xAIModes = [
"grok-2-vision-1212",
"grok-2-vision",
"grok-2-vision-latest",
"grok-3-mini-fast-beta",
"grok-3-mini-fast",
"grok-3-mini-fast-latest",
"grok-3-mini-beta",
"grok-3-mini",
"grok-3-mini-latest",
"grok-3-fast-beta",
"grok-3-fast",
"grok-3-fast-latest",
"grok-3-beta",
"grok-3",
"grok-3-latest",
];
const chatglmModels = [

View File

@ -2,16 +2,16 @@
{
"id": "dalle3",
"name": "Dalle3",
"schema": "https://ghp.ci/https://raw.githubusercontent.com/ChatGPTNextWeb/NextChat-Awesome-Plugins/main/plugins/dalle/openapi.json"
"schema": "https://cdn.jsdelivr.net/gh/ChatGPTNextWeb/NextChat-Awesome-Plugins@main/plugins/dalle/openapi.json"
},
{
"id": "arxivsearch",
"name": "ArxivSearch",
"schema": "https://ghp.ci/https://raw.githubusercontent.com/ChatGPTNextWeb/NextChat-Awesome-Plugins/main/plugins/arxivsearch/openapi.json"
"schema": "https://cdn.jsdelivr.net/gh/ChatGPTNextWeb/NextChat-Awesome-Plugins@main/plugins/arxivsearch/openapi.json"
},
{
"id": "duckduckgolite",
"name": "DuckDuckGoLiteSearch",
"schema": "https://ghp.ci/https://raw.githubusercontent.com/ChatGPTNextWeb/NextChat-Awesome-Plugins/main/plugins/duckduckgolite/openapi.json"
"schema": "https://cdn.jsdelivr.net/gh/ChatGPTNextWeb/NextChat-Awesome-Plugins@main/plugins/duckduckgolite/openapi.json"
}
]

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,13 @@
import fetch from "node-fetch";
import fs from "fs/promises";
const RAW_FILE_URL = "https://raw.githubusercontent.com/";
const MIRRORF_FILE_URL = "http://raw.fgit.ml/";
const MIRRORF_FILE_URL = "https://cdn.jsdelivr.net/gh/";
const RAW_CN_URL = "PlexPt/awesome-chatgpt-prompts-zh/main/prompts-zh.json";
const RAW_CN_URL = "PlexPt/awesome-chatgpt-prompts-zh@main/prompts-zh.json";
const CN_URL = MIRRORF_FILE_URL + RAW_CN_URL;
const RAW_TW_URL = "PlexPt/awesome-chatgpt-prompts-zh/main/prompts-zh-TW.json";
const RAW_TW_URL = "PlexPt/awesome-chatgpt-prompts-zh@main/prompts-zh-TW.json";
const TW_URL = MIRRORF_FILE_URL + RAW_TW_URL;
const RAW_EN_URL = "f/awesome-chatgpt-prompts/main/prompts.csv";
const RAW_EN_URL = "f/awesome-chatgpt-prompts@main/prompts.csv";
const EN_URL = MIRRORF_FILE_URL + RAW_EN_URL;
const FILE = "./public/prompts.json";
@ -84,11 +83,11 @@ async function fetchEN() {
async function main() {
Promise.all([fetchCN(), fetchTW(), fetchEN()])
.then(([cn, tw, en]) => {
fs.writeFile(FILE, JSON.stringify({ cn, tw, en }));
fs.writeFile(FILE, JSON.stringify({ cn, tw, en }, null, 2));
})
.catch((e) => {
console.error("[Fetch] failed to fetch prompts");
fs.writeFile(FILE, JSON.stringify({ cn: [], tw: [], en: [] }));
fs.writeFile(FILE, JSON.stringify({ cn: [], tw: [], en: [] }, null, 2));
})
.finally(() => {
console.log("[Fetch] saved to " + FILE);