"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "0ec1f9e331f07b0aadc1247fa38b8023c62059ea"
Commit 9cc46629 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

refac

parent a0362917
...@@ -492,6 +492,12 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware): ...@@ -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)): ...@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment