Browse Source

enh: __metadata__ param for tools & functions

Co-Authored-By: DmitriyAlergant-T1A <93501479+dmitriyalergant-t1a@users.noreply.github.com>
Timothy Jaeryang Baek 5 tháng trước cách đây
mục cha
commit
e3485d2d88
2 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 1 0
      backend/open_webui/apps/webui/main.py
  2. 1 0
      backend/open_webui/main.py

+ 1 - 0
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,

+ 1 - 0
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