瀏覽代碼

enh: __metadata__ param for tools & functions

Co-Authored-By: DmitriyAlergant-T1A <93501479+dmitriyalergant-t1a@users.noreply.github.com>
Timothy Jaeryang Baek 5 月之前
父節點
當前提交
e3485d2d88
共有 2 個文件被更改,包括 2 次插入0 次删除
  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