From fed47f2e2b2917f7fc033cec2e386dc03c8a2c99 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Tue, 8 Apr 2025 01:00:06 -0400 Subject: [PATCH] Add content param to /search route --- backend/open_webui/routers/files.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/open_webui/routers/files.py b/backend/open_webui/routers/files.py index 61ee89f43..8a2888d86 100644 --- a/backend/open_webui/routers/files.py +++ b/backend/open_webui/routers/files.py @@ -189,6 +189,7 @@ async def search_files( ..., description="Filename pattern to search for. Supports wildcards such as '*.txt'", ), + content: bool = Query(True), user=Depends(get_verified_user), ): """ @@ -210,6 +211,11 @@ async def search_files( status_code=status.HTTP_404_NOT_FOUND, detail="No files found matching the pattern.", ) + + if not content: + for file in matching_files: + del file.data["content"] + return matching_files