mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-21 13:38:19 -05:00
fix: apply connection prefix id to the model display name as well as the id (#28950)
This commit is contained in:
@@ -427,6 +427,8 @@ async def get_all_models(request: Request, user: UserModel | None = None):
|
||||
for m in response.get('models', []):
|
||||
if prefix_id:
|
||||
m['model'] = f'{prefix_id}.{m["model"]}'
|
||||
if m.get('name'):
|
||||
m['name'] = f'{prefix_id}.{m["name"]}'
|
||||
if allowed_tags:
|
||||
m['tags'] = allowed_tags
|
||||
if connection_type:
|
||||
|
||||
@@ -747,6 +747,8 @@ async def get_all_models_responses(request: Request, user: UserModel) -> list:
|
||||
|
||||
if prefix_id:
|
||||
model['id'] = f'{prefix_id}.{model.get("id", model.get("name", ""))}'
|
||||
if model.get('name'):
|
||||
model['name'] = f'{prefix_id}.{model["name"]}'
|
||||
|
||||
if tags:
|
||||
model['tags'] = tags
|
||||
|
||||
Reference in New Issue
Block a user