mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
put tool_ids and files in metadata
This commit is contained in:
@@ -731,12 +731,10 @@ async def generate_chat_completion(
|
||||
url_idx: Optional[int] = None,
|
||||
user=Depends(get_verified_user),
|
||||
):
|
||||
log.debug(f"{form_data.model_dump_json(exclude_none=True).encode()}=")
|
||||
|
||||
payload = {**form_data.model_dump(exclude_none=True)}
|
||||
for key in ["metadata", "files", "tool_ids"]:
|
||||
if key in payload:
|
||||
del payload[key]
|
||||
log.debug(f"{payload = }")
|
||||
if "metadata" in payload:
|
||||
del payload["metadata"]
|
||||
|
||||
model_id = form_data.model
|
||||
model_info = Models.get_model_by_id(model_id)
|
||||
|
||||
@@ -273,10 +273,12 @@ def get_function_params(function_module, form_data, user, extra_params={}):
|
||||
return params
|
||||
|
||||
|
||||
async def generate_function_chat_completion(form_data, user, files, tool_ids):
|
||||
async def generate_function_chat_completion(form_data, user):
|
||||
model_id = form_data.get("model")
|
||||
model_info = Models.get_model_by_id(model_id)
|
||||
metadata = form_data.pop("metadata", None)
|
||||
metadata = form_data.pop("metadata", {})
|
||||
files = metadata.get("files", [])
|
||||
tool_ids = metadata.get("tool_ids", [])
|
||||
|
||||
__event_emitter__ = None
|
||||
__event_call__ = None
|
||||
|
||||
Reference in New Issue
Block a user