소스 검색

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