mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
feat: save tags to chat data
This commit is contained in:
@@ -189,6 +189,7 @@
|
||||
},
|
||||
messages: messages,
|
||||
history: history,
|
||||
tags: [],
|
||||
timestamp: Date.now()
|
||||
});
|
||||
await chats.set(await getChatList(localStorage.token));
|
||||
@@ -690,11 +691,19 @@
|
||||
const addTag = async (tagName) => {
|
||||
const res = await addTagById(localStorage.token, $chatId, tagName);
|
||||
tags = await getTags();
|
||||
|
||||
chat = await updateChatById(localStorage.token, $chatId, {
|
||||
tags: tags
|
||||
});
|
||||
};
|
||||
|
||||
const deleteTag = async (tagName) => {
|
||||
const res = await deleteTagById(localStorage.token, $chatId, tagName);
|
||||
tags = await getTags();
|
||||
|
||||
chat = await updateChatById(localStorage.token, $chatId, {
|
||||
tags: tags
|
||||
});
|
||||
};
|
||||
|
||||
const setChatTitle = async (_chatId, _title) => {
|
||||
|
||||
@@ -707,11 +707,19 @@
|
||||
const addTag = async (tagName) => {
|
||||
const res = await addTagById(localStorage.token, $chatId, tagName);
|
||||
tags = await getTags();
|
||||
|
||||
chat = await updateChatById(localStorage.token, $chatId, {
|
||||
tags: tags.map((tag) => tag.name)
|
||||
});
|
||||
};
|
||||
|
||||
const deleteTag = async (tagName) => {
|
||||
const res = await deleteTagById(localStorage.token, $chatId, tagName);
|
||||
tags = await getTags();
|
||||
|
||||
chat = await updateChatById(localStorage.token, $chatId, {
|
||||
tags: tags.map((tag) => tag.name)
|
||||
});
|
||||
};
|
||||
|
||||
onMount(async () => {
|
||||
|
||||
Reference in New Issue
Block a user