refac
This commit is contained in:
@@ -618,19 +618,11 @@ async def get_builtin_tools(
|
||||
builtin_functions.append(execute_code)
|
||||
|
||||
# Notes tools - search, view, create, and update user's notes
|
||||
if (
|
||||
is_builtin_tool_enabled('notes')
|
||||
and config.get('notes.enable')
|
||||
and await has_user_permission('notes')
|
||||
):
|
||||
if is_builtin_tool_enabled('notes') and config.get('notes.enable') and await has_user_permission('notes'):
|
||||
builtin_functions.extend([search_notes, view_note, write_note, replace_note_content])
|
||||
|
||||
# Channels tools - search channels and messages
|
||||
if (
|
||||
is_builtin_tool_enabled('channels')
|
||||
and config.get('channels.enable')
|
||||
and await has_user_permission('channels')
|
||||
):
|
||||
if is_builtin_tool_enabled('channels') and config.get('channels.enable') and await has_user_permission('channels'):
|
||||
builtin_functions.extend(
|
||||
[
|
||||
search_channels,
|
||||
@@ -659,11 +651,7 @@ async def get_builtin_tools(
|
||||
)
|
||||
|
||||
# Calendar tools - search/create/update/delete events
|
||||
if (
|
||||
is_builtin_tool_enabled('calendar')
|
||||
and config.get('calendar.enable')
|
||||
and await has_user_permission('calendar')
|
||||
):
|
||||
if is_builtin_tool_enabled('calendar') and config.get('calendar.enable') and await has_user_permission('calendar'):
|
||||
builtin_functions.extend(
|
||||
[search_calendar_events, create_calendar_event, update_calendar_event, delete_calendar_event]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user