From 9cc46629c2ed4d59cee3ef8746a07119282bb43b Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 1 Jul 2024 15:43:19 -0700 Subject: [PATCH] refac --- backend/main.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/backend/main.py b/backend/main.py index df3f884b3..e1172f026 100644 --- a/backend/main.py +++ b/backend/main.py @@ -492,6 +492,12 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware): "__id__": filter_id, } + if "__model__" in sig.parameters: + params = { + **params, + "__model__": model, + } + if inspect.iscoroutinefunction(inlet): data = await inlet(**params) else: @@ -1083,6 +1089,12 @@ async def chat_completed(form_data: dict, user=Depends(get_verified_user)): "__id__": filter_id, } + if "__model__" in sig.parameters: + params = { + **params, + "__model__": model, + } + if inspect.iscoroutinefunction(outlet): data = await outlet(**params) else: