This commit is contained in:
Timothy Jaeryang Baek committed 2026-07-27 02:29:56 -04:00
1 parent 98656b7c5e
commit e28b391e51
2 files changed
+3 -4

No files matched your search

-1
View File
@@ -11,7 +11,6 @@ from aiocache import cached
from fastapi import HTTPException, Request, status from fastapi import HTTPException, Request, status
from open_webui.env import BYPASS_MODEL_ACCESS_CONTROL, GLOBAL_LOG_LEVEL from open_webui.env import BYPASS_MODEL_ACCESS_CONTROL, GLOBAL_LOG_LEVEL
from open_webui.functions import generate_function_chat_completion from open_webui.functions import generate_function_chat_completion
from open_webui.models.functions import Functions
from open_webui.models.models import Models from open_webui.models.models import Models
from open_webui.models.users import UserModel from open_webui.models.users import UserModel
from open_webui.routers.ollama import ( from open_webui.routers.ollama import (
@@ -113,8 +113,7 @@
const id = node.getAttribute('data-id') || ''; const id = node.getAttribute('data-id') || '';
// TipTap stores the trigger char in data-mention-suggestion-char (usually "@") // TipTap stores the trigger char in data-mention-suggestion-char (usually "@")
const ch = node.getAttribute('data-mention-suggestion-char') || '@'; const ch = node.getAttribute('data-mention-suggestion-char') || '@';
// Skills are always serialized as <$id|label>, even when selected from "/". const mentionChar = ch === '/' ? '$' : ch;
const mentionChar = id.includes('|') ? '$' : ch;
return `<${mentionChar}${id}>`; return `<${mentionChar}${id}>`;
} }
}); });
@@ -284,7 +283,8 @@
const getMentionText = ({ node, suggestion }) => { const getMentionText = ({ node, suggestion }) => {
const id = node.attrs.id ?? ''; const id = node.attrs.id ?? '';
const label = node.attrs.label ?? id; const label = node.attrs.label ?? id;
const char = id.includes('|') ? '$' : (suggestion?.char ?? '@'); const ch = node.attrs.mentionSuggestionChar ?? suggestion?.char ?? '@';
const char = ch === '/' ? '$' : ch;
return `${char}${label}`; return `${char}${label}`;
}; };