mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-21 16:26:49 +08:00
Compare commits
8 Commits
812c1c770c
...
6305-bugth
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d4180f5be | ||
|
|
9f0182b55e | ||
|
|
2167076652 | ||
|
|
e123076250 | ||
|
|
ebcb4db245 | ||
|
|
f3154b20a5 | ||
|
|
f5f3ce94f6 | ||
|
|
2b5f600308 |
18
README.md
18
README.md
@@ -41,6 +41,24 @@ English / [简体中文](./README_CN.md)
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
## 👋 Hey, NextChat is going to develop a native app!
|
||||||
|
|
||||||
|
> This week we are going to start working on iOS and Android APP, and we want to find some reliable friends to do it together!
|
||||||
|
|
||||||
|
|
||||||
|
✨ Several key points:
|
||||||
|
|
||||||
|
- Starting from 0, you are a veteran
|
||||||
|
- Completely open source, not hidden
|
||||||
|
- Native development, pursuing the ultimate experience
|
||||||
|
|
||||||
|
Will you come and do something together? 😎
|
||||||
|
|
||||||
|
https://github.com/ChatGPTNextWeb/NextChat/issues/6269
|
||||||
|
|
||||||
|
#Seeking for talents is thirsty #lack of people
|
||||||
|
|
||||||
|
|
||||||
## 🥳 Cheer for DeepSeek, China's AI star!
|
## 🥳 Cheer for DeepSeek, China's AI star!
|
||||||
> Purpose-Built UI for DeepSeek Reasoner Model
|
> Purpose-Built UI for DeepSeek Reasoner Model
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,25 @@ export class DeepSeekApi implements LLMApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检测并修复消息顺序,确保除system外的第一个消息是user
|
||||||
|
const filteredMessages: ChatOptions["messages"] = [];
|
||||||
|
let hasFoundFirstUser = false;
|
||||||
|
|
||||||
|
for (const msg of messages) {
|
||||||
|
if (msg.role === "system") {
|
||||||
|
// Keep all system messages
|
||||||
|
filteredMessages.push(msg);
|
||||||
|
} else if (msg.role === "user") {
|
||||||
|
// User message directly added
|
||||||
|
filteredMessages.push(msg);
|
||||||
|
hasFoundFirstUser = true;
|
||||||
|
} else if (hasFoundFirstUser) {
|
||||||
|
// After finding the first user message, all subsequent non-system messages are retained.
|
||||||
|
filteredMessages.push(msg);
|
||||||
|
}
|
||||||
|
// If hasFoundFirstUser is false and it is not a system message, it will be skipped.
|
||||||
|
}
|
||||||
|
|
||||||
const modelConfig = {
|
const modelConfig = {
|
||||||
...useAppConfig.getState().modelConfig,
|
...useAppConfig.getState().modelConfig,
|
||||||
...useChatStore.getState().currentSession().mask.modelConfig,
|
...useChatStore.getState().currentSession().mask.modelConfig,
|
||||||
@@ -85,7 +104,7 @@ export class DeepSeekApi implements LLMApi {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const requestPayload: RequestPayload = {
|
const requestPayload: RequestPayload = {
|
||||||
messages,
|
messages: filteredMessages,
|
||||||
stream: options.config.stream,
|
stream: options.config.stream,
|
||||||
model: modelConfig.model,
|
model: modelConfig.model,
|
||||||
temperature: modelConfig.temperature,
|
temperature: modelConfig.temperature,
|
||||||
|
|||||||
@@ -66,11 +66,11 @@ export function Avatar(props: { model?: ModelType; avatar?: string }) {
|
|||||||
LlmIcon = BotIconGemma;
|
LlmIcon = BotIconGemma;
|
||||||
} else if (modelName.startsWith("claude")) {
|
} else if (modelName.startsWith("claude")) {
|
||||||
LlmIcon = BotIconClaude;
|
LlmIcon = BotIconClaude;
|
||||||
} else if (modelName.toLowerCase().includes("llama")) {
|
} else if (modelName.includes("llama")) {
|
||||||
LlmIcon = BotIconMeta;
|
LlmIcon = BotIconMeta;
|
||||||
} else if (modelName.startsWith("mixtral")) {
|
} else if (modelName.startsWith("mixtral") || modelName.startsWith("codestral")) {
|
||||||
LlmIcon = BotIconMistral;
|
LlmIcon = BotIconMistral;
|
||||||
} else if (modelName.toLowerCase().includes("deepseek")) {
|
} else if (modelName.includes("deepseek")) {
|
||||||
LlmIcon = BotIconDeepseek;
|
LlmIcon = BotIconDeepseek;
|
||||||
} else if (modelName.startsWith("moonshot")) {
|
} else if (modelName.startsWith("moonshot")) {
|
||||||
LlmIcon = BotIconMoonshot;
|
LlmIcon = BotIconMoonshot;
|
||||||
@@ -85,7 +85,7 @@ export function Avatar(props: { model?: ModelType; avatar?: string }) {
|
|||||||
} else if (modelName.startsWith("doubao") || modelName.startsWith("ep-")) {
|
} else if (modelName.startsWith("doubao") || modelName.startsWith("ep-")) {
|
||||||
LlmIcon = BotIconDoubao;
|
LlmIcon = BotIconDoubao;
|
||||||
} else if (
|
} else if (
|
||||||
modelName.toLowerCase().includes("glm") ||
|
modelName.includes("glm") ||
|
||||||
modelName.startsWith("cogview-") ||
|
modelName.startsWith("cogview-") ||
|
||||||
modelName.startsWith("cogvideox-")
|
modelName.startsWith("cogvideox-")
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -535,6 +535,8 @@ const anthropicModels = [
|
|||||||
"claude-3-5-sonnet-20240620",
|
"claude-3-5-sonnet-20240620",
|
||||||
"claude-3-5-sonnet-20241022",
|
"claude-3-5-sonnet-20241022",
|
||||||
"claude-3-5-sonnet-latest",
|
"claude-3-5-sonnet-latest",
|
||||||
|
"claude-3-7-sonnet-20250219",
|
||||||
|
"claude-3-7-sonnet-latest",
|
||||||
];
|
];
|
||||||
|
|
||||||
const baiduModels = [
|
const baiduModels = [
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
{
|
{
|
||||||
"id": "dalle3",
|
"id": "dalle3",
|
||||||
"name": "Dalle3",
|
"name": "Dalle3",
|
||||||
"schema": "https://cdn.jsdelivr.net/gh/ChatGPTNextWeb/NextChat-Awesome-Plugins@main/plugins/dalle/openapi.json"
|
"schema": "https://ghp.ci/https://raw.githubusercontent.com/ChatGPTNextWeb/NextChat-Awesome-Plugins/main/plugins/dalle/openapi.json"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "arxivsearch",
|
"id": "arxivsearch",
|
||||||
"name": "ArxivSearch",
|
"name": "ArxivSearch",
|
||||||
"schema": "https://cdn.jsdelivr.net/gh/ChatGPTNextWeb/NextChat-Awesome-Plugins@main/plugins/arxivsearch/openapi.json"
|
"schema": "https://ghp.ci/https://raw.githubusercontent.com/ChatGPTNextWeb/NextChat-Awesome-Plugins/main/plugins/arxivsearch/openapi.json"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "duckduckgolite",
|
"id": "duckduckgolite",
|
||||||
"name": "DuckDuckGoLiteSearch",
|
"name": "DuckDuckGoLiteSearch",
|
||||||
"schema": "https://cdn.jsdelivr.net/gh/ChatGPTNextWeb/NextChat-Awesome-Plugins@main/plugins/duckduckgolite/openapi.json"
|
"schema": "https://ghp.ci/https://raw.githubusercontent.com/ChatGPTNextWeb/NextChat-Awesome-Plugins/main/plugins/duckduckgolite/openapi.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,14 @@
|
|||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
import fs from "fs/promises";
|
import fs from "fs/promises";
|
||||||
|
|
||||||
const MIRRORF_FILE_URL = "https://cdn.jsdelivr.net/gh/";
|
const RAW_FILE_URL = "https://raw.githubusercontent.com/";
|
||||||
|
const MIRRORF_FILE_URL = "http://raw.fgit.ml/";
|
||||||
|
|
||||||
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 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 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 EN_URL = MIRRORF_FILE_URL + RAW_EN_URL;
|
||||||
const FILE = "./public/prompts.json";
|
const FILE = "./public/prompts.json";
|
||||||
|
|
||||||
@@ -83,11 +84,11 @@ async function fetchEN() {
|
|||||||
async function main() {
|
async function main() {
|
||||||
Promise.all([fetchCN(), fetchTW(), fetchEN()])
|
Promise.all([fetchCN(), fetchTW(), fetchEN()])
|
||||||
.then(([cn, tw, en]) => {
|
.then(([cn, tw, en]) => {
|
||||||
fs.writeFile(FILE, JSON.stringify({ cn, tw, en }, null, 2));
|
fs.writeFile(FILE, JSON.stringify({ cn, tw, en }));
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.error("[Fetch] failed to fetch prompts");
|
console.error("[Fetch] failed to fetch prompts");
|
||||||
fs.writeFile(FILE, JSON.stringify({ cn: [], tw: [], en: [] }, null, 2));
|
fs.writeFile(FILE, JSON.stringify({ cn: [], tw: [], en: [] }));
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
console.log("[Fetch] saved to " + FILE);
|
console.log("[Fetch] saved to " + FILE);
|
||||||
|
|||||||
Reference in New Issue
Block a user