mirror of
https://github.com/open-webui/open-webui
synced 2025-01-18 16:51:17 +00:00
enh: ChatValves
This commit is contained in:
parent
8dcb3d78dc
commit
9f9122b6d7
@ -165,6 +165,10 @@ async def get_pipe_models():
|
|||||||
f"{function_module.name}{manifold_pipe_name}"
|
f"{function_module.name}{manifold_pipe_name}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
pipe_flag = {"type": pipe.type}
|
||||||
|
if hasattr(function_module, "ChatValves"):
|
||||||
|
pipe_flag["valves_spec"] = function_module.ChatValves.schema()
|
||||||
|
|
||||||
pipe_models.append(
|
pipe_models.append(
|
||||||
{
|
{
|
||||||
"id": manifold_pipe_id,
|
"id": manifold_pipe_id,
|
||||||
@ -172,10 +176,14 @@ async def get_pipe_models():
|
|||||||
"object": "model",
|
"object": "model",
|
||||||
"created": pipe.created_at,
|
"created": pipe.created_at,
|
||||||
"owned_by": "openai",
|
"owned_by": "openai",
|
||||||
"pipe": {"type": pipe.type},
|
"pipe": pipe_flag,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
pipe_flag = {"type": "pipe"}
|
||||||
|
if hasattr(function_module, "ChatValves"):
|
||||||
|
pipe_flag["valves_spec"] = function_module.ChatValves.schema()
|
||||||
|
|
||||||
pipe_models.append(
|
pipe_models.append(
|
||||||
{
|
{
|
||||||
"id": pipe.id,
|
"id": pipe.id,
|
||||||
@ -183,7 +191,7 @@ async def get_pipe_models():
|
|||||||
"object": "model",
|
"object": "model",
|
||||||
"created": pipe.created_at,
|
"created": pipe.created_at,
|
||||||
"owned_by": "openai",
|
"owned_by": "openai",
|
||||||
"pipe": {"type": "pipe"},
|
"pipe": pipe_flag,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user