mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-31 03:09:04 +08:00
Compare commits
7 Commits
Leizhenpen
...
6305-bugth
Author | SHA1 | Date | |
---|---|---|---|
|
2d4180f5be | ||
|
9f0182b55e | ||
|
2167076652 | ||
|
e123076250 | ||
|
ebcb4db245 | ||
|
f3154b20a5 | ||
|
f5f3ce94f6 |
@@ -56,7 +56,7 @@ Will you come and do something together? 😎
|
|||||||
|
|
||||||
https://github.com/ChatGPTNextWeb/NextChat/issues/6269
|
https://github.com/ChatGPTNextWeb/NextChat/issues/6269
|
||||||
|
|
||||||
#Seeking for talents is thirsty #lack of people"
|
#Seeking for talents is thirsty #lack of people
|
||||||
|
|
||||||
|
|
||||||
## 🥳 Cheer for DeepSeek, China's AI star!
|
## 🥳 Cheer for DeepSeek, China's AI star!
|
||||||
|
@@ -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 = [
|
||||||
|
Reference in New Issue
Block a user