mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-11 03:38:02 +00:00
fix: skill search does not find a skill by its translated name (#32174)
Searching Workspace > Skills only matched a skill's original name, description and id, so typing the German name given to a skill in its editor found nothing, even with the interface in German. The search now also matches the names and descriptions translated in the skill editor, in any language, so both the translated and the original name find the skill, as the Translations page in the docs says. Fixes #32018
This commit is contained in:
parent
cdd96e5b57
commit
1579af28a0
1 changed files with 6 additions and 1 deletions
|
|
@ -8,9 +8,10 @@ from open_webui.models.access_grants import AccessGrant, AccessGrantModel, Acces
|
|||
from open_webui.models.groups import Groups
|
||||
from open_webui.models.skill_history import SkillHistories, SkillHistory
|
||||
from open_webui.models.users import User, UserModel, UserResponse, Users
|
||||
from open_webui.utils.misc import json_text_variants
|
||||
from open_webui.utils.skill_files import SkillFile, SkillFileOperation, apply_operations, validate_files
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from sqlalchemy import JSON, BigInteger, Boolean, Column, String, Text, delete, func, or_, select, update
|
||||
from sqlalchemy import JSON, BigInteger, Boolean, Column, String, Text, cast, delete, func, or_, select, update
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
|
@ -301,6 +302,10 @@ class SkillsTable:
|
|||
Skill.id.ilike(f'%{query_key}%'),
|
||||
User.name.ilike(f'%{query_key}%'),
|
||||
User.email.ilike(f'%{query_key}%'),
|
||||
*(
|
||||
cast(Skill.meta, String).icontains(variant, autoescape=True)
|
||||
for variant in json_text_variants(query_key)
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue