mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-14 05:15:18 +00:00
refac
This commit is contained in:
parent
a03629178e
commit
9cc46629c2
1 changed files with 12 additions and 0 deletions
|
|
@ -492,6 +492,12 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware):
|
||||||
"__id__": filter_id,
|
"__id__": filter_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if "__model__" in sig.parameters:
|
||||||
|
params = {
|
||||||
|
**params,
|
||||||
|
"__model__": model,
|
||||||
|
}
|
||||||
|
|
||||||
if inspect.iscoroutinefunction(inlet):
|
if inspect.iscoroutinefunction(inlet):
|
||||||
data = await inlet(**params)
|
data = await inlet(**params)
|
||||||
else:
|
else:
|
||||||
|
|
@ -1083,6 +1089,12 @@ async def chat_completed(form_data: dict, user=Depends(get_verified_user)):
|
||||||
"__id__": filter_id,
|
"__id__": filter_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if "__model__" in sig.parameters:
|
||||||
|
params = {
|
||||||
|
**params,
|
||||||
|
"__model__": model,
|
||||||
|
}
|
||||||
|
|
||||||
if inspect.iscoroutinefunction(outlet):
|
if inspect.iscoroutinefunction(outlet):
|
||||||
data = await outlet(**params)
|
data = await outlet(**params)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue