From bd47bbbce90e01a4421d29dbc4d8e0c7e05c361d Mon Sep 17 00:00:00 2001 From: Michael Poluektov Date: Tue, 20 Aug 2024 17:41:51 +0100 Subject: [PATCH] fix tools filter --- backend/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/main.py b/backend/main.py index f00d6c382..2c0c810c9 100644 --- a/backend/main.py +++ b/backend/main.py @@ -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