diff --git a/backend/open_webui/apps/webui/main.py b/backend/open_webui/apps/webui/main.py index ae54ab29a..593dcb533 100644 --- a/backend/open_webui/apps/webui/main.py +++ b/backend/open_webui/apps/webui/main.py @@ -406,6 +406,7 @@ async def generate_function_chat_completion(form_data, user, models: dict = {}): "name": user.name, "role": user.role, }, + "__metadata__": metadata, } extra_params["__tools__"] = get_tools( app, diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 9230469d3..6f2c7ac42 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -604,6 +604,7 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware): "name": user.name, "role": user.role, }, + "__metadata__": metadata, } # Initialize data_items to store additional data to be sent to the client