chore: format
This commit is contained in:
@@ -165,9 +165,7 @@ def process_uploaded_file(
|
||||
request.app.state.config, "STT_SUPPORTED_CONTENT_TYPES", []
|
||||
)
|
||||
|
||||
if strict_match_mime_type(
|
||||
stt_supported_content_types, content_type
|
||||
):
|
||||
if strict_match_mime_type(stt_supported_content_types, content_type):
|
||||
file_path_processed = Storage.get_file(file_path)
|
||||
result = transcribe(
|
||||
request, file_path_processed, file_metadata, user
|
||||
|
||||
@@ -65,12 +65,18 @@ async def get_tools(
|
||||
|
||||
# Local Tools
|
||||
for tool in Tools.get_tools(defer_content=True, db=db):
|
||||
tool_module = request.app.state.TOOLS.get(tool.id) if hasattr(request.app.state, 'TOOLS') else None
|
||||
tool_module = (
|
||||
request.app.state.TOOLS.get(tool.id)
|
||||
if hasattr(request.app.state, "TOOLS")
|
||||
else None
|
||||
)
|
||||
tools.append(
|
||||
ToolUserResponse(
|
||||
**{
|
||||
**tool.model_dump(),
|
||||
"has_user_valves": hasattr(tool_module, "UserValves") if tool_module else False,
|
||||
"has_user_valves": (
|
||||
hasattr(tool_module, "UserValves") if tool_module else False
|
||||
),
|
||||
}
|
||||
)
|
||||
)
|
||||
@@ -212,8 +218,13 @@ async def get_tool_list(
|
||||
or any(
|
||||
g.permission == "write"
|
||||
and (
|
||||
(g.principal_type == "user" and (g.principal_id == user.id or g.principal_id == "*"))
|
||||
or (g.principal_type == "group" and g.principal_id in user_group_ids)
|
||||
(
|
||||
g.principal_type == "user"
|
||||
and (g.principal_id == user.id or g.principal_id == "*")
|
||||
)
|
||||
or (
|
||||
g.principal_type == "group" and g.principal_id in user_group_ids
|
||||
)
|
||||
)
|
||||
for g in tool.access_grants
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user