mirror of
https://github.com/open-webui/open-webui
synced 2025-01-31 06:49:03 +00:00
Merge pull request #4798 from open-webui/dev
fix: filter compatibility issue
This commit is contained in:
commit
e2b7296786
@ -525,9 +525,8 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware):
|
||||
"chat_id": body.pop("chat_id", None),
|
||||
"message_id": body.pop("id", None),
|
||||
"session_id": body.pop("session_id", None),
|
||||
"valves": body.pop("valves", None),
|
||||
"tool_ids": body.pop("tool_ids", None),
|
||||
"files": body.pop("files", None),
|
||||
"tool_ids": body.get("tool_ids", None),
|
||||
"files": body.get("files", None),
|
||||
}
|
||||
body["metadata"] = metadata
|
||||
|
||||
@ -560,6 +559,13 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware):
|
||||
content={"detail": str(e)},
|
||||
)
|
||||
|
||||
metadata = {
|
||||
**metadata,
|
||||
"tool_ids": body.pop("tool_ids", None),
|
||||
"files": body.pop("files", None),
|
||||
}
|
||||
body["metadata"] = metadata
|
||||
|
||||
try:
|
||||
body, flags = await chat_completion_tools_handler(body, user, extra_params)
|
||||
contexts.extend(flags.get("contexts", []))
|
||||
|
Loading…
Reference in New Issue
Block a user