Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
tianjing-li committed Nov 8, 2024
1 parent 5ebe4d9 commit 7ebf299
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/backend/routers/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def list_tools(
for tool in all_tools:
# Tools with auth implementation can be enabled and visible but not accessible (e.g., if secrets are not set).
# Therefore, we need to set is_auth_required for these types of tools as well for the frontend.
if (tool.is_available or tool.is_visible) and tool.auth_implementation is not None:
if (tool.is_available or tool.is_enabled) and tool.auth_implementation is not None:
try:
tool_auth_service = tool.auth_implementation()

Expand Down
7 changes: 3 additions & 4 deletions src/backend/services/auth/strategies/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,13 @@ class BaseOAuthStrategy:
def __init__(self, *args, **kwargs):
self._post_init_check()

@classmethod
def _post_init_check(cls):
def _post_init_check(self):
if any(
[
cls.NAME is None,
self.NAME is None,
]
):
raise ValueError(f"{cls.__name__} must have NAME attribute defined.")
raise ValueError(f"{self.__name__} must have NAME attribute defined.")

@abstractmethod
def get_client_id(self, **kwargs: Any):
Expand Down
9 changes: 4 additions & 5 deletions src/backend/tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ def __init__(self, *args, **kwargs):

self._post_init_check()

@classmethod
def _post_init_check(cls):
def _post_init_check(self):
if any(
[
cls.BACKEND_HOST is None,
cls.FRONTEND_HOST is None,
cls.AUTH_SECRET_KEY is None,
self.BACKEND_HOST is None,
self.FRONTEND_HOST is None,
self.AUTH_SECRET_KEY is None,
]
):
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion src/backend/tools/slack/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_tool_definition(cls) -> ToolDefinition:
"required": True,
}
},
is_enabled=True,
is_enabled=False,
is_available=cls.is_available(),
is_default_tool=False,
is_background_tool=False,
Expand Down

0 comments on commit 7ebf299

Please sign in to comment.