mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-18 15:25:20 +00:00
Merge clean-summary: 摘要机制安全实现(编码修复)
This commit is contained in:
parent
83161615a3
commit
71cbbc8722
4 changed files with 7 additions and 3 deletions
BIN
backend/open_webui/utils/chat_importer.py
Normal file
BIN
backend/open_webui/utils/chat_importer.py
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,4 +1,4 @@
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import sha256 from 'js-sha256';
|
import sha256 from 'js-sha256';
|
||||||
import { WEBUI_BASE_URL } from '$lib/constants';
|
import { WEBUI_BASE_URL } from '$lib/constants';
|
||||||
|
|
||||||
|
|
@ -213,6 +213,10 @@ export const convertMessagesToHistory = (messages) => {
|
||||||
currentId: null
|
currentId: null
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!messages || !Array.isArray(messages)) {
|
||||||
|
return history;
|
||||||
|
}
|
||||||
|
|
||||||
let parentMessageId = null;
|
let parentMessageId = null;
|
||||||
let messageId = null;
|
let messageId = null;
|
||||||
|
|
||||||
|
|
@ -699,7 +703,7 @@ export const getUserPosition = async (raw = false) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const convertOpenAIMessages = (convo) => {
|
export const convertOpenAIMessages = (convo) => {
|
||||||
// Parse OpenAI chat messages and create chat dictionary for creating new chats
|
// Parse OpenAI chat messages and create chat dictionary for creating new chats
|
||||||
const mapping = convo['mapping'];
|
const mapping = convo['mapping'];
|
||||||
const messages = [];
|
const messages = [];
|
||||||
|
|
@ -765,7 +769,7 @@ const fragmentsToContent = (fragments: any) => {
|
||||||
.join('\n\n');
|
.join('\n\n');
|
||||||
};
|
};
|
||||||
|
|
||||||
const convertDeepseekMessages = (convo) => {
|
export const convertDeepseekMessages = (convo) => {
|
||||||
// Parse DeepSeek chat messages (mapping + fragments) into chat dictionary
|
// Parse DeepSeek chat messages (mapping + fragments) into chat dictionary
|
||||||
const mapping = convo['mapping'];
|
const mapping = convo['mapping'];
|
||||||
const messages = [];
|
const messages = [];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue