diff --git a/backend/open_webui/utils/chat.py b/backend/open_webui/utils/chat.py index 8b0d729b24..3cc3000100 100644 --- a/backend/open_webui/utils/chat.py +++ b/backend/open_webui/utils/chat.py @@ -11,7 +11,6 @@ from aiocache import cached from fastapi import HTTPException, Request, status from open_webui.env import BYPASS_MODEL_ACCESS_CONTROL, GLOBAL_LOG_LEVEL 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.users import UserModel from open_webui.routers.ollama import ( diff --git a/src/lib/components/common/RichTextInput.svelte b/src/lib/components/common/RichTextInput.svelte index dfe18126ad..bd608722d4 100644 --- a/src/lib/components/common/RichTextInput.svelte +++ b/src/lib/components/common/RichTextInput.svelte @@ -113,8 +113,7 @@ const id = node.getAttribute('data-id') || ''; // TipTap stores the trigger char in data-mention-suggestion-char (usually "@") const ch = node.getAttribute('data-mention-suggestion-char') || '@'; - // Skills are always serialized as <$id|label>, even when selected from "/". - const mentionChar = id.includes('|') ? '$' : ch; + const mentionChar = ch === '/' ? '$' : ch; return `<${mentionChar}${id}>`; } }); @@ -284,7 +283,8 @@ const getMentionText = ({ node, suggestion }) => { const id = node.attrs.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}`; };