fix: apply connection prefix id to the model display name as well as the id (#28950)
This commit is contained in:
2 files changed
+4
No files matched your search
@@ -427,6 +427,8 @@ async def get_all_models(request: Request, user: UserModel | None = None):
|
|||||||
for m in response.get('models', []):
|
for m in response.get('models', []):
|
||||||
if prefix_id:
|
if prefix_id:
|
||||||
m['model'] = f'{prefix_id}.{m["model"]}'
|
m['model'] = f'{prefix_id}.{m["model"]}'
|
||||||
|
if m.get('name'):
|
||||||
|
m['name'] = f'{prefix_id}.{m["name"]}'
|
||||||
if allowed_tags:
|
if allowed_tags:
|
||||||
m['tags'] = allowed_tags
|
m['tags'] = allowed_tags
|
||||||
if connection_type:
|
if connection_type:
|
||||||
|
|||||||
@@ -747,6 +747,8 @@ async def get_all_models_responses(request: Request, user: UserModel) -> list:
|
|||||||
|
|
||||||
if prefix_id:
|
if prefix_id:
|
||||||
model['id'] = f'{prefix_id}.{model.get("id", model.get("name", ""))}'
|
model['id'] = f'{prefix_id}.{model.get("id", model.get("name", ""))}'
|
||||||
|
if model.get('name'):
|
||||||
|
model['name'] = f'{prefix_id}.{model["name"]}'
|
||||||
|
|
||||||
if tags:
|
if tags:
|
||||||
model['tags'] = tags
|
model['tags'] = tags
|
||||||
|
|||||||
Reference in new issue
Block a user