mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 13:40:55 +00:00
Merge pull request #4760 from michaelpoluektov/tools-refac-2.1
Fix: tools filter
This commit is contained in:
commit
20dadf9b5a
@ -529,6 +529,7 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware):
|
||||
"tool_ids": body.pop("tool_ids", None),
|
||||
"files": body.pop("files", None),
|
||||
}
|
||||
body["metadata"] = metadata
|
||||
|
||||
__user__ = {
|
||||
"id": user.id,
|
||||
@ -600,7 +601,6 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware):
|
||||
if len(citations) > 0:
|
||||
data_items.append({"citations": citations})
|
||||
|
||||
body["metadata"] = metadata
|
||||
modified_body_bytes = json.dumps(body).encode("utf-8")
|
||||
# Replace the request body with the modified one
|
||||
request._body = modified_body_bytes
|
||||
|
Loading…
Reference in New Issue
Block a user