mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-10 03:27:57 +00:00
perf: early-return in get_tools() for empty tool_ids (#21873)
Avoids a needless Groups.get_groups_by_member_id() query when no tools are attached to the request.
This commit is contained in:
parent
9dff497abf
commit
b2413f914a
1 changed files with 3 additions and 0 deletions
|
|
@ -163,6 +163,9 @@ async def get_tools(
|
|||
request: Request, tool_ids: list[str], user: UserModel, extra_params: dict
|
||||
) -> dict[str, dict]:
|
||||
"""Load tools for the given tool_ids, checking access control."""
|
||||
if not tool_ids:
|
||||
return {}
|
||||
|
||||
tools_dict = {}
|
||||
|
||||
# Get user's group memberships for access control checks
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue