Skip to content

Conversation

@EugeneLightsOn
Copy link
Collaborator

@EugeneLightsOn EugeneLightsOn commented Oct 24, 2024

Slack Tool implementation

SlackTool.mp4

AI Description

This PR adds a new Slack tool to the deployable all-in-one RAG application. The Slack tool allows users to search Slack for relevant document snippets.

The PR includes the following changes:

  • A new file, docs/custom_tool_guides/slack.md, is added, which provides instructions for setting up the Slack tool.
  • The poetry.lock file is updated to include the slack-sdk package, which is required for the Slack tool.
  • The pyproject.toml file is updated to include the slack-sdk package as a dependency.
  • The src/backend/config/configuration.template.yaml file is updated to include a new slack section, which specifies the user scopes required for the Slack tool.
  • The src/backend/config/secrets.template.yaml file is updated to include a new slack section, which specifies the client ID and client secret required for the Slack tool.
  • The src/backend/config/settings.py file is updated to include a new SlackSettings class, which is used to configure the Slack tool.
  • The src/backend/config/tools.py file is updated to include new SlackAuth and SlackTool classes, which are used to authenticate and interact with the Slack tool.
  • The src/backend/tools/__init__.py file is updated to include new SlackAuth and SlackTool classes, which are used to authenticate and interact with the Slack tool.
  • The src/backend/tools/base.py file is updated to include a new tool_auth_crud.delete_tool_auth method, which is used to delete tool authentication information.
  • The src/backend/tools/slack/__init__.py file is added, which imports the SlackAuth, SlackTool, and SLACK_TOOL_ID constants from the backend.tools.slack module.
  • The src/backend/tools/slack/auth.py file is added, which defines the SlackAuth class, which is used to authenticate the Slack tool.
  • The src/backend/tools/slack/client.py file is added, which defines the SlackClient class, which is used to interact with the Slack API.
  • The src/backend/tools/slack/constants.py file is added, which defines the SEARCH_LIMIT and SLACK_TOOL_ID constants, which are used by the Slack tool.
  • The src/backend/tools/slack/tool.py file is added, which defines the SlackTool class, which is used to search Slack for relevant document snippets.
  • The src/backend/tools/slack/utils.py file is added, which defines the SlackService class, which is used to interact with the Slack API.
  • The src/interfaces/assistants_web/src/app/(main)/settings/Settings.tsx file is updated to include a new SlackConnection component, which is used to display the Slack connection status.
  • The src/interfaces/assistants_web/src/components/AgentSettingsForm/StatusConnection.tsx file is added, which defines the StatusConnection component, which is used to display the Slack connection status.
  • The src/interfaces/assistants_web/src/components/AgentSettingsForm/ToolsStep.tsx file is updated to include a new handleAuthButtonClick prop, which is used to handle authentication for the Slack tool.
  • The src/interfaces/assistants_web/src/components/AgentSettingsForm/index.tsx file is updated to include a new handleAuthButtonClick method, which is used to handle authentication for the Slack tool.
  • The src/interfaces/assistants_web/src/components/UI/Icon.tsx file is updated to include a new Slack component, which is used to display the Slack icon.
  • The src/interfaces/assistants_web/src/constants/tools.ts file is updated to include a new TOOL_SLACK_ID constant, which is used to identify the Slack tool.

@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 44.44444% with 105 lines in your changes missing coverage. Please review.

Project coverage is 79.12%. Comparing base (642f2ad) to head (a51a069).

Files with missing lines Patch % Lines
src/backend/tools/slack/auth.py 37.83% 46 Missing ⚠️
src/backend/tools/slack/utils.py 27.58% 42 Missing ⚠️
src/backend/tools/slack/tool.py 64.70% 12 Missing ⚠️
src/backend/tools/slack/client.py 57.14% 3 Missing ⚠️
src/backend/tools/base.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #821      +/-   ##
==========================================
- Coverage   79.73%   79.12%   -0.61%     
==========================================
  Files         244      250       +6     
  Lines       10486    10673     +187     
==========================================
+ Hits         8361     8445      +84     
- Misses       2125     2228     +103     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tianjing-li
Copy link
Collaborator

Great PR. Added a couple comments.

In addition:
Client-side, can we remove Slack as a tool for the base Agent
image

I also have some general questions for the tool -> service -> client architecture, I'll reach out in Slack

@EugeneLightsOn
Copy link
Collaborator Author

Great PR. Added a couple comments.

In addition: Client-side, can we remove Slack as a tool for the base Agent image

I also have some general questions for the tool -> service -> client architecture, I'll reach out in Slack

I've added a constant to manage which tools should be excluded from the base agent.

@EugeneLightsOn EugeneLightsOn added this pull request to the merge queue Nov 1, 2024
Merged via the queue into main with commit 404f286 Nov 1, 2024
@EugeneLightsOn EugeneLightsOn deleted the eugene/TLK-1725_slack_tool branch November 1, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants