mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 11:57:51 +01:00
refac: show connection type for custom models
This commit is contained in:
@@ -191,6 +191,8 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
|
|||||||
):
|
):
|
||||||
# Custom model based on a base model
|
# Custom model based on a base model
|
||||||
owned_by = "openai"
|
owned_by = "openai"
|
||||||
|
connection_type = None
|
||||||
|
|
||||||
pipe = None
|
pipe = None
|
||||||
|
|
||||||
for m in models:
|
for m in models:
|
||||||
@@ -201,6 +203,8 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
|
|||||||
owned_by = m.get("owned_by", "unknown")
|
owned_by = m.get("owned_by", "unknown")
|
||||||
if "pipe" in m:
|
if "pipe" in m:
|
||||||
pipe = m["pipe"]
|
pipe = m["pipe"]
|
||||||
|
|
||||||
|
connection_type = m.get("connection_type", None)
|
||||||
break
|
break
|
||||||
|
|
||||||
model = {
|
model = {
|
||||||
@@ -209,6 +213,7 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
|
|||||||
"object": "model",
|
"object": "model",
|
||||||
"created": custom_model.created_at,
|
"created": custom_model.created_at,
|
||||||
"owned_by": owned_by,
|
"owned_by": owned_by,
|
||||||
|
"connection_type": connection_type,
|
||||||
"preset": True,
|
"preset": True,
|
||||||
**({"pipe": pipe} if pipe is not None else {}),
|
**({"pipe": pipe} if pipe is not None else {}),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user