mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
Add content param to /search route
This commit is contained in:
parent
1c60b8d543
commit
fed47f2e2b
1 changed files with 6 additions and 0 deletions
|
|
@ -189,6 +189,7 @@ async def search_files(
|
||||||
...,
|
...,
|
||||||
description="Filename pattern to search for. Supports wildcards such as '*.txt'",
|
description="Filename pattern to search for. Supports wildcards such as '*.txt'",
|
||||||
),
|
),
|
||||||
|
content: bool = Query(True),
|
||||||
user=Depends(get_verified_user),
|
user=Depends(get_verified_user),
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
|
|
@ -210,6 +211,11 @@ async def search_files(
|
||||||
status_code=status.HTTP_404_NOT_FOUND,
|
status_code=status.HTTP_404_NOT_FOUND,
|
||||||
detail="No files found matching the pattern.",
|
detail="No files found matching the pattern.",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not content:
|
||||||
|
for file in matching_files:
|
||||||
|
del file.data["content"]
|
||||||
|
|
||||||
return matching_files
|
return matching_files
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue