mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-01 01:12:43 -05:00
feat: find models by their ID in the admin and workspace model search (#35297)
Searching in Admin Settings > Models only matched the display name, and Workspace > Models matched the name, the base model and the owner but not the model's own ID. A model that was renamed, or whose name differs from its ID, could not be found by typing the ID that the tooltip and the API show. Both searches now match the ID too, like the chat model selector, tools and functions searches already do. Fixes #35296
This commit is contained in:
1 parent
0e984be144
commit
fcfdc472a7
2 files changed
+7
-1
No files matched your search
@@ -518,6 +518,7 @@ class ModelsTable:
|
||||
stmt = stmt.filter(
|
||||
or_(
|
||||
Model.name.ilike(f'%{query_key}%'),
|
||||
Model.id.ilike(f'%{query_key}%'),
|
||||
Model.base_model_id.ilike(f'%{query_key}%'),
|
||||
User.name.ilike(f'%{query_key}%'),
|
||||
User.email.ilike(f'%{query_key}%'),
|
||||
|
||||
@@ -165,7 +165,12 @@
|
||||
|
||||
filteredModels = models
|
||||
.filter((m) => !selectedTag || modelTags(m).includes(selectedTag))
|
||||
.filter((m) => searchValue === '' || m.name.toLowerCase().includes(searchValue.toLowerCase()))
|
||||
.filter(
|
||||
(m) =>
|
||||
searchValue === '' ||
|
||||
m.name.toLowerCase().includes(searchValue.toLowerCase()) ||
|
||||
m.id.toLowerCase().includes(searchValue.toLowerCase())
|
||||
)
|
||||
.filter((m) => {
|
||||
if (viewOption === 'available') return availableModelIds.has(m.id) || isPresetModel(m);
|
||||
if (viewOption === 'unavailable') return !availableModelIds.has(m.id) && !isPresetModel(m);
|
||||
|
||||
Reference in new issue
Block a user