From e51722348a521cc21f56bc1998b42c33e768b30e Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 24 Dec 2024 19:27:17 -0700 Subject: [PATCH] refac --- backend/open_webui/utils/chat.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/utils/chat.py b/backend/open_webui/utils/chat.py index 262e2b75d..1cfae4d54 100644 --- a/backend/open_webui/utils/chat.py +++ b/backend/open_webui/utils/chat.py @@ -114,7 +114,7 @@ async def generate_chat_completion( yield chunk response = await generate_chat_completion( - form_data, user, bypass_filter=True + request, form_data, user, bypass_filter=True ) return StreamingResponse( stream_wrapper(response.body_iterator), @@ -123,14 +123,18 @@ async def generate_chat_completion( ) else: return { - **(await generate_chat_completion(form_data, user, bypass_filter=True)), + **( + await generate_chat_completion( + request, form_data, user, bypass_filter=True + ) + ), "selected_model_id": selected_model_id, } if model.get("pipe"): # Below does not require bypass_filter because this is the only route the uses this function and it is already bypassing the filter return await generate_function_chat_completion( - form_data, user=user, models=models + request, form_data, user=user, models=models ) if model["owned_by"] == "ollama": # Using /ollama/api/chat endpoint