This commit is contained in:
Timothy J. Baek 2024-07-01 15:43:19 -07:00
parent a03629178e
commit 9cc46629c2

View File

@ -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: